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

Forums / Sitefinity SDK / How to GetTags

How to GetTags

6 posts, 0 answered
  1. Caedmon
    Caedmon avatar
    10 posts
    Registered:
    02 Feb 2011
    01 Mar 2011
    Link to this post
    In the 3.0 forum there was a note from the forum admin:

    "Tags are created per provider and you cannot have tags for a single library. Tags are associated with a content items - IContent object and not with the ILibrary object. You can get all tags for a given item by using GetTags(Guid contentId) - Get all Tags for a specific content item by passing its ID"

    How can this be accomplished in 4.x?

    Thanks!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    01 Mar 2011
    Link to this post
    Hello Caedmon,

    Please take a look at this post.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Caedmon
    Caedmon avatar
    10 posts
    Registered:
    02 Feb 2011
    08 Mar 2011
    Link to this post
    Yes, that's perfect for pulling all content items related to a tag.  What I need to do is pull all tags related to a content item.  An event to be specific.  

    So, event 1 has tags (1, 2, 3, 4) associated with it.  I'm not seeing how to pull this from the SF framework in a User Control.

    Thanks for all that you do!
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    09 Mar 2011
    Link to this post
    Hello Caedmon,

    You can use GetValue extension method


    using Telerik.Sitefinity.Model;

    ..
     ..

    var news = App.WorkWith().NewsItems().Get().First();
    var tags = news.GetValue("Tags");

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  5. Caedmon
    Caedmon avatar
    10 posts
    Registered:
    02 Feb 2011
    10 Mar 2011
    Link to this post
    Thanks very much!

    What types of content are the Guid's that are returned in the TrackedList<Guid>?

    Thanks!
  6. Caedmon
    Caedmon avatar
    10 posts
    Registered:
    02 Feb 2011
    10 Mar 2011
    Link to this post
    Got it:

    var taxon = manager.GetTaxa<FlatTaxon>().Where(t => t.Id == id).FirstOrDefault();


    Thanks for your help!
6 posts, 0 answered