Show TOC

Background documentationCreating a Top-Level Navigation iView Locate this document in the navigation structure

 

The code sample below creates a one- or two-level top-level navigation iView by performing the following steps:

  1. Iterates through the initial nodes

  2. Saves the node that is selected

  3. After iterating through all the initial nodes, recalls the selected node and iterates through its children.

Syntax Syntax

  1. <%@ 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>
    
End of the code.