
The code sample below creates a one- or two-level top-level navigation iView by performing the following steps:
Iterates through the initial nodes
Saves the node that is selected
After iterating through all the initial nodes, recalls the selected node and iterates through its children.
<%@ taglib uri="NavigationTagLibrary" prefix="nav"%>
<%-- render first level --%>
<ul class="firstLevel">
<nav:iterateInitialNavNodes>
<li>
<nav:ifNavNodeInSelectedPath>
<nav:navNodeAnchor
navigationMethod="byURL"
useQuickLink="true"
anchorAttributes="class=\"selected\""/>
<nav:storeNavNode id="first"/>
</nav:ifNavNodeInSelectedPath>
<nav:ifNotNavNodeInSelectedPath>
<nav:navNodeAnchor
navigationMethod="byURL"
useQuickLink="true"/>
</nav:ifNotNavNodeInSelectedPath>
</li>
</nav:iterateInitialNavNodes>
</ul>
<%-- render second level --%>
<nav:recallNavNode id="first">
<ul class="secondLevel">
<nav:iterateNavNodeChildren>
<li>
<nav:ifNavNodeInSelectedPath>
<nav:navNodeAnchor
navigationMethod="byURL"
useQuickLink="true"
anchorAttributes="class=\"selected\""/>
</nav:ifNavNodeInSelectedPath>
<nav:ifNotNavNodeInSelectedPath>
<nav:navNodeAnchor
navigationMethod="byURL"
useQuickLink="true"/>
</nav:ifNotNavNodeInSelectedPath>
</li>
</nav:iterateNavNodeChildren>
</ul>
</nav:recallNavNode>