Show TOC

iterateRelatedNavNodesLocate this document in the navigation structure

Use

Iterates through the list of related nodes of the current navigation node.

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. Use this tag together with the relatedNavNodeAnchor tag for rendering a link for each related node.

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 which 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

An INavigationNode object representing the current node in the iteration.

Cooperating Tags

The tag must be nested in one of the following tags:

  • contextNavNode

  • iterateInitialNavNodes

  • iterateNavNodeChildren

  • iterateNavNodesInSelectedPath

  • iterateSelectedNavNodesLevel

  • launchedNavNode

  • navNode

  • navNodeParent

  • recallNavNode

  • recurseNavNodeChildren

  • selectedNavNode

Example

The following displays a list of related links, if the current context node has related nodes.

<nav:contextNavNode>
    <nav:ifNavNodeHasRelatedNavNodes>
        <ul>
        <nav:iterateRelatedNavNodes>
            <li class="relatedLink">
                <nav:relatedNavNodeAnchor navigationMethod="byURL"/>
            </li>
        </nav:iterateRelatedNavNodes>
        </ul>
    </nav:ifNavNodeHasRelatedNavNodes>
</nav:contextNavNode>