Last active
January 3, 2016 08:29
-
-
Save jhorsman/8436700 to your computer and use it in GitHub Desktop.
Fiddling with Tridion CD Taxonomies...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mytax.TaxonomyFilter = | |
new DepthFilter(DepthFilter.UnlimitedDepth, DepthFilter.FilterDown); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment