Dynamically filter the taxonomy structure based on the values of another field
We will configure the Tridion Docs SES Connector in such a way the values a user selected for another field limits the terms he can select for this field. This type of filtering configuration can be combined with entry points and relational filtering.
About this task
In Hypothetical taxonomy tree structure we defined a certain taxonomy structure. Instead of always showing the entire taxonomy structure, we will configure the field FLOCATION in such a way it will dynamically filter the tree structure based on the values selected by the user for another field (FCONTINENTS). As this filter is dynamic, the tree structure shown depends on the values chosen in the other field. We will limit the user so he can only select cities.
- If the user did not select anything yet, the tree structure is unfiltered and looks like this:
Continents {id=34, class=category, selectable=no} - Australia {id=5, class=continent, selectable=no} - Australia {id=38, class=country, selectable=no} - Sydney {id=46, class=city, selectable=yes} - Europe {id=17, class=continent, selectable=no} - France {id=105, class=country, selectable=no} - Paris {id=12, class=city, selectable=yes} Hemispheres {id=99, class=category, selectable=no} - Northern {id=203, class=hemisphere, selectable=no} - Southern {id=14, class=hemisphere, selectable=no} - If the user selected the continent Australia in the other field, the tree structure would look like this:
Continents {id=34, class=category, selectable=no} - Australia {id=5, class=continent, selectable=no} - Australia {id=38, class=country, selectable=no} - Sydney {id=46, class=city, selectable=yes} - If the user selected the continent Europe in the other field, the tree structure would look like this:
Continents {id=34, class=category, selectable=no} - Europe {id=17, class=continent, selectable=no} - France {id=105, class=country, selectable=no} - Paris {id=12, class=city, selectable=yes} - If the user selected both Australia and Europe you would see both Australia and Europe with their countries and cities.
Procedure
Results
<infoShareExtensionConfig version="1.0">
<metadatabindings>
<metadatabinding ishfieldname="FLOCATION" sourceref="SESExampleModelDataSource" />
<metadatabinding ishfieldname="FCONTINENTS" sourceref="SESExampleModelDataSource" />
</metadatabindings>
<sources>
<source id="SESExampleModelDataSource" handler="SmartLogicSESConnector">
<initialize>
<parameters>
<parameter name="ses.api.url">http://smartlogic.example.com/ses</parameter>
<parameter name="ses.api.tbdb">Example</parameter>
<parameter name="metadatabinding">
<fields>
<field name="FLOCATION" level="logical">
<read>
<entrynodes/>
<fieldfilters>
<field name='FCONTINENTS' level='logical'/>
</fieldfilters>
<selectable>
<condition name="CLASS">city</condition>
</selectable>
<relations>
<relation ref="narrowerterm" />
</relations>
</read>
</field>
<field name="FCONTINENTS" level="logical">
<read>
<entrynodes>
<static>
<id>34</id> <!-- 34 is the id of Continents -->
</static>
</entrynodes>
<fieldfilters/>
<selectable>
<condition name="CLASS">continent</condition>
</selectable>
<relations>
<relation ref="narrowerterm" />
</relations>
</read>
</field>
</fields>
</parameter>
<parameter name="relations">
<relations>
<relation type="hierarchical" id="narrowerterm" abbreviation="NT" direction="Forward"/>
</relations>
</parameter>
</parameters>
</initialize>
</source>
</sources>
</infoShareExtensionConfig>