I created a dynamic module with lots of content. There is a detail page for each piece of content and on that detail page, I would like to list the taxonomy that the content item is associated with. The module has many flat taxonomy references/fields (one to one and one to many's) plus some choice fields.
What I would like to know is how to get all (particular) taxonomy for a specific content item. So how do I get all taxonomy of type "datasources" for example? Here is my code thus far which does not seem to work
DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager(providerName);
Type measureType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.DataContent.Measure");
DynamicContent measureItem = dynamicModuleManager.GetDataItem(measureType, measureID);
var manager = TaxonomyManager.GetManager();
var tags = measureItem.GetValue<TrackedList<Guid>>("compendiumdatasources");
foreach (Guid itm in tags)
//itm.ToString() --- The GUID's I get are incorrect
Any advice on what I am doing wrong? Thanks so very much.
Victor, thanks for your continued help!
I assumed that "TAXONOMY_DEVELOPER_NAME" is the machine name for the flat taxonomy I created, right? In this case, it is "compendium-data-sources". The other thing is that measureItem.GetPropertyValue was not valid so I used measureItem.GetValue. Am I missing something here? still I am not getting any results, unfortunately.
It must be related somehow though as in the backend it pulls up just fine. When editing the content, all the relationships are there and accurate.
Hi Victor, thank you for your reply. I guess where I go here from here might be the problem. When debugging, it seems that the "tags" (aka compendiumdatasources) is yielding no results even though they are associated with data in the backend. I've tried with other flat taxonomy fields for the same content and it has yielded the same results. All I get for "tags" is Telerik.OpenAccess.TrackedList`1[System.Guid]. Iterating through tags gives me nothing.
Thank you for your help.
It is not so straight forward to check dependencies in Sitefinity database.
Try to execute this source code:
TaxonomyManager taxonomyManager = TaxonomyManager.GetManager();
FlatTaxonomy tagTaxonomy = taxonomyManager.GetTaxonomies<FlatTaxonomy>().SingleOrDefault(t => t.Name ==
var listOfTags =
var tags = measureItem.GetPropertyValue<TrackedList<Guid>>(
Taxon tag = tagTaxonomy.Taxa.SingleOrDefault(x => x.Id == tagId);
Is your measuteItem object have Master or Live version? (Reference how to receive master or live docs.sitefinity.com/for-developers-query-master-and-live-versions)
I think that the reason why you cant receive taxonomies. Please try to receive item with Live version and get tags for this object