How to get BlogPost categories and tags?

Posted by Community Admin on 04-Aug-2018 11:10

How to get BlogPost categories and tags?

All Replies

Posted by Community Admin on 13-Jun-2011 00:00

Hello
How can I get the Category and Tag taxons associated with a BlogPost item?

Thanks
Ryan

Posted by Community Admin on 13-Jun-2011 00:00

Hello Ryan,

Please take a look at this post

www.sitefinity.com/.../how-to-filter-news-by-custom-classification.aspx

All the best,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 13-Jun-2011 00:00

Hi Ivan
That post doesn't seem to be what I'm looking for.
In a Listview I have

RadListViewDataItem item = e.Item as RadListViewDataItem;
BlogPost bp = (BlogPost)item.DataItem;

From which I can extract title, content, etc, but I don't know how to get the taxonomies from it. I can see bp.Organizer, but I can seem to extract values from it.
Thanks
Ryan

Posted by Community Admin on 13-Jun-2011 00:00

Hello Ryan,

You can use GetValue extension method and pass the "Category" or "Tags" as a parameter or you can use TypeDescriptior.GetProperties(object)

Best wishes,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 13-Jun-2011 00:00

Got it

var cats = (Telerik.OpenAccess.TrackedList<System.Guid>)bp.GetValue("Category");

Gives me a list of Guids I can lookup
Thanks Ivan
Ryan

This thread is closed