How to GetTags

Posted by Community Admin on 05-Aug-2018 15:32

How to GetTags

All Replies

Posted by Community Admin on 01-Mar-2011 00:00

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!

Posted by Community Admin on 01-Mar-2011 00:00

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!

Posted by Community Admin on 08-Mar-2011 00:00

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!

Posted by Community Admin on 09-Mar-2011 00:00

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!

Posted by Community Admin on 10-Mar-2011 00:00

Thanks very much!

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

Thanks!

Posted by Community Admin on 10-Mar-2011 00:00

Got it:

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


Thanks for your help!

This thread is closed