jan-h
1/15/2014 - 1:58 PM

Fiddling with Tridion CD Taxonomies...

Fiddling with Tridion CD Taxonomies...

    if (!String.IsNullOrEmpty(Request.Params["Keyword"]))
       {
           TaxonomyFactory taxonomyFactory = new TaxonomyFactory();
           Keyword selectedKeyword = taxonomyFactory.GetTaxonomyKeyword(Request.Params["Keyword"]);
           Keyword[] selectedKeywords = { selectedKeyword };
           
           ComponentPresentationFactory presentationfactory = new ComponentPresentationFactory(7);
           ComponentPresentation[] componentPresentations = presentationfactory.GetTaxonomyComponentPresentations(selectedKeywords, "tcm:69-6306-32", true);
           foreach (ComponentPresentation cp in componentPresentations)
           {
               taxonomyOutput.Text += cp.Content;
           }
       }
TaxonomyFactory tf = new TaxonomyFactory();
CompositeFilter filter = new CompositeFilter();
filter.DepthFiltering(2, DepthFilter.FilterDown);
Keyword root = tf.GetTaxonomyKeywords("tcm:69-269-512", filter, "tcm:69-2421-1024");
taxonomyOutput.Text += "root keyword: " + root.KeywordName + "<br/>";
foreach (Keyword child in root.KeywordChildren)
{
     taxonomyOutput.Text += "<li>" + child.KeywordName + "</li>";
}
mytax.TaxonomyFilter = 
	new DepthFilter(DepthFilter.UnlimitedDepth, DepthFilter.FilterDown);