Connected Taxonomies
OrchestraCMS provides content authors the ability to assign categories to content items. These categories can be used with the OrchestraCMS taxonomies features to offer subscriptions to categories and to allow the dynamic loading of content based on visitor selections of the associated categories. For example, in a retail setting selecting a category of product, such as electronics results, in an array of product content items which fall into the electronics category loading on the page.
If the developer wants to conditionally execute code or render markup based on the categories assigned to content from a taxonomy, the content template can be connected to a taxonomy; and any taxonomy categories assigned to the content by the content author will be saved as an attribute of the content that can be called from the renderer class.
Setup
In order for the categories to be saved with any content based on a given content template, that content template must be connected to the taxonomy that contains the category. This is done in OrchestraCMS Setup | Templates | Content Templates by editing any content template and selecting one or more desired taxonomies in the Assign Taxonomies field. This needs to be done for all content templates where the developer wants to make use of the categories assigned to content of that content template by the content author.
Accessors
The attribute name for any category assigned to the content is renderTagPath. For each category assigned to the content, there is a separate renderTagPath attribute saved with the content. Since there may be mulitple categories assigned to any content, the accessor is a List.
public List<String> categories {
get{
return (List<String>) this.getPropertyList('renderTagPath');
}
}
The resulting categories List will contain values in the format /TaxonomyName/CategoryName/SubCategory. For example /Products/Electronics/Computers. The values in the list can then be used in your Apex code to perform conditional logic or rendering.