Show TOC

iterateInitialNavNodesLocate this document in the navigation structure

Use

Iterates through the top-level navigation nodes.

During each iteration of the tag, a different node is exposed in the body of the tag, either via a cooperating tag that accesses the current node in the iteration or the scriptlet variable defined by the currentNavNode attribute.

Attributes

Name

Mandatory

Description

currentNavNode

No

The name of the Java variable to create for holding the INavigationNode object for the current node in the iteration.

The variable can be accessed in scriptlets in the body of the tag.

direction

No

Indicates in what direction to iterate. The attribute can have the following values:

  • forward (default) : Iterate from the first to the last node.

  • backward: Iterate from the last to the first node.

Variables

Name

Scope

Description

< currentNavNode > attribute

Body of tag

INavigationNode object representing the current node in the iteration.

Example

The following iterates through all the top-level navigation nodes and creates a link for each one.

<ul>
<nav:iterateInitialNavNodes>
    <nav:ifNavNodeInSelectedPath>
        <li class="selectedLevel1">
            <nav:navNodeAnchor navigationMethod="byURL"/>
        </li>
        <% if(levels==2) { %>
            <nav:storeNavNode/>
        <% } %>
    </nav:ifNavNodeInSelectedPath>
    <nav:ifNotNavNodeInSelectedPath>
        <li class="unselectedLevel1">
            <nav:navNodeAnchor navigationMethod="byURL"/>
        </li>
    </nav:ifNotNavNodeInSelectedPath>
</nav:iterateInitialNavNodes>
</ul>