Pull Categories
Is there a way to pull Categories from code behind?
I have a category called Regions, (under Content > Categories) that has several subcategories. I want to get all the children of the parent category (Regions).
I thought I could just pull the Region category, and then loops through it's children but it is returning null.
var taxonomy = manager.GetTaxonomies<
HierarchicalTaxonomy
>().Where(t => t.Name == "regions").Single();
Ok nevermind I figured it out:
To get Taxa by it's Parent Name:
TaxonomyManager manager = TaxonomyManager.GetManager();
var taxa = manager.GetTaxa<
HierarchicalTaxon
>().Where(t => t.Parent.Name == "regions");
foreach (var item in taxa)
//Do Stuff