Show TOC

ifNextRecursionDepthWillDecreaseLocate this document in the navigation structure

Use

Includes its body if the next node in a recursive iteration is a node at a higher level than the current node. This happens when either there are more nodes and the current node has no children or any more siblings, or there are no more nodes (end of recursion) and the current node is lower than the first level.

Attributes

depthDecrement: Optional. Specifies the number of levels the next recursion step decreases.

Cooperating Tags

The tag must be nested in the following tag:

recurseNavNodeChildren

Example

The following displays a site map of all navigation nodes using nested unordered lists for markup. Here, the ifNextRecursionDepthWillDecrease tag closes the <li> tag belonging to the current node. The tag also closes the <ul> and <li> tags of the current level and upper levels as many times as necessary, since either the next recursion pass continues with a sibling of the current node's parent node or the recursion ends after this node.

            <ul>
<nav:iterateInitialNavNodes>
    <nav:recurseNavNodeChildren>
    <li>        
        <nav:navNodeAnchor navigationMethod="byURL"/>

        <nav:ifNextRecursionDepthWillNotChange>
            </li>
        </nav:ifNextRecursionDepthWillNotChange>

        <nav:ifNextRecursionDepthWillIncrease>
            <ul>
        </nav:ifNextRecursionDepthWillIncrease>

        <nav:ifNextRecursionDepthWillDecrease>
            </li>
            <nav:decreaseRecursionDepthLoop>
                </ul></li>
            </nav:decreaseRecursionDepthLoop>
        </nav:ifNextRecursionDepthWillDecrease>
    </nav:recurseNavNodeChildren>
</nav:iterateInitialNavNodes>
</ul>

         

Alternatively, to close some HTML tags while decreasing the recursion depth, you can use a scripting variable of the Byte type, which you define in the ifNextRecursionDepthWillDecrease tag and use within a scriptlet:

            <ul>
<nav:iterateInitialNavNodes>
    <nav:recurseNavNodeChildren>
    <li>        
        <nav:navNodeAnchor navigationMethod="byURL"/>

        <nav:ifNextRecursionDepthWillNotChange>
            </li>
        </nav:ifNextRecursionDepthWillNotChange>

        <nav:ifNextRecursionDepthWillIncrease>
            <ul>
        </nav:ifNextRecursionDepthWillIncrease>

        <nav:ifNextRecursionDepthWillDecrease 
         depthDecrement="theDecrement">
            </li>
            <%
            byte dec = theDecrement.byteValue();
            for(byte b = 0; b < dec; b++) {
                %></ul></li><%
            }
            %>
        </nav:ifNextRecursionDepthWillDecrease>
    </nav:recurseNavNodeChildren>
</nav:iterateInitialNavNodes>
</ul>