1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to get BlogPost categories and tags?

How to get BlogPost categories and tags?

5 posts, 1 answered
  1. Ian
    Ian avatar
    75 posts
    Registered:
    25 Oct 2010
    13 Jun 2011
    Link to this post
    Hello
    How can I get the Category and Tag taxons associated with a BlogPost item?

    Thanks
    Ryan
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    13 Jun 2011
    Link to this post
    Hello Ryan,

    Please take a look at this post

    http://www.sitefinity.com/devnet/forums/sitefinity-4-x/sdk/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
  3. Ian
    Ian avatar
    75 posts
    Registered:
    25 Oct 2010
    13 Jun 2011
    Link to this post
    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
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    13 Jun 2011
    Link to this post
    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
    Answered
  5. Ian
    Ian avatar
    75 posts
    Registered:
    25 Oct 2010
    13 Jun 2011
    Link to this post
    Got it

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

    Gives me a list of Guids I can lookup
    Thanks Ivan
    Ryan
5 posts, 1 answered