Hello community,
I have the following problem: I want to render
- the complete navigation tree (expansionVisibility=all),
- but only for the selected 1st level node and
- no matter which sub-nodes of that 1st level node are selected (wholePathSelected=1)
Therefore I need to
- either dynamically set the root parameter
- or set the level that the navigation should start at (meaning: show only level 2+ nodes only under the selected 1st level node).
Does the Navigation function offer either of these possibilities? I didn't find anything about this in the documentation/help.
Right now my Navigation function looks as follows:
<CMS_FUNCTION name="Navigation" resultname="fr_dtn">
<CMS_PARAM name="expansionVisibility" value="all"/>
<CMS_PARAM name="wholePathSelected" value="1"/>
<CMS_PARAM name="suppressEmptyFolders" value="1" />
<CMS_ARRAY_PARAM name="innerBeginHTML">
<CMS_ARRAY_ELEMENT index="1..9"><![CDATA[<ul>]]></CMS_ARRAY_ELEMENT>
</CMS_ARRAY_PARAM>
<CMS_ARRAY_PARAM name="innerEndHTML">
<CMS_ARRAY_ELEMENT index="1..9"><![CDATA[</ul>]]></CMS_ARRAY_ELEMENT>
</CMS_ARRAY_PARAM>
<CMS_ARRAY_PARAM name="endHTML">
<CMS_ARRAY_ELEMENT index="1..9"><![CDATA[</li>]]></CMS_ARRAY_ELEMENT>
</CMS_ARRAY_PARAM>
<CMS_ARRAY_PARAM name="unselectedHTML">
<CMS_ARRAY_ELEMENT index="1..9">
<![CDATA[
...
]]>
</CMS_ARRAY_ELEMENT>
</CMS_ARRAY_PARAM>
<CMS_ARRAY_PARAM name="selectedHTML">
<CMS_ARRAY_ELEMENT index="1..9">
<![CDATA[
...
]]>
</CMS_ARRAY_ELEMENT>
</CMS_ARRAY_PARAM>
</CMS_FUNCTION>
But this way the sub-nodes of all 1st level nodes that are not selected will be rendered, as well.
My only solution (hopefully) for this problem seems to be to add something like
<CMS_ARRAY_PARAM name="unselectedHTML">
<CMS_ARRAY_ELEMENT index="0">
<![CDATA[$CMS_SET(1st_level_selected,false)$]]>
</CMS_ARRAY_ELEMENT>
<CMS_ARRAY_ELEMENT index="1..9">
<![CDATA[
$CMS_IF(1st_level_selected)$
...
$CMS_END_IF$
]]>
</CMS_ARRAY_ELEMENT>
</CMS_ARRAY_PARAM>
<CMS_ARRAY_PARAM name="selectedHTML">
<CMS_ARRAY_ELEMENT index="0">
<![CDATA[$CMS_SET(1st_level_selected,true)$]]>
</CMS_ARRAY_ELEMENT>
<CMS_ARRAY_ELEMENT index="1..9">
<![CDATA[
$CMS_IF(1st_level_selected)$
...
$CMS_END_IF$
]]>
</CMS_ARRAY_ELEMENT>
</CMS_ARRAY_PARAM>
Is this the only possible solution? Thank you for your replies in advance!
Regards,
René Schubert