Show TOC

Background documentationCreating a Related Links iView Locate this document in the navigation structure

 

The code sample below creates a related links iView by performing the following steps:

  1. Retrieves the context navigation node, which is located at the end of the selected path and also displayed in the content area.

  2. If the context node has one or more related nodes, renders the Related Links title and starts the iteration.

    Single related links are rendered with the different class-attributes, depending on whether the related link has been clicked and launched in the content area.

    To launch all related links in place, each link is rendered with the navigationMode attribute equal to "0" (INavigationConstants.SHOW_INPLACE). You can omit the navigationMode attribute to open the related link according to the related node's property setting.

Example

Syntax Syntax

  1. <%@ taglib uri="NavigationTagLibrary" prefix="nav"%>
    
    <nav:contextNavNode>
        <nav:ifNavNodeHasRelatedNavNodes>
            <h3>Related Links</h3>
            <ul>
            <nav:iterateRelatedNavNodes>
                <li>
                <nav:ifNavNodeEqualsLaunchedNavNode>
                    <nav:relatedNavNodeAnchor 
                        navigationMethod="byURL"
                        navigationMode="0"
                        anchorAttributes="class=\"selected\""/>
                </nav:ifNavNodeEqualsLaunchedNavNode>
                <nav:ifNotNavNodeEqualsLaunchedNavNode>
                    <nav:relatedNavNodeAnchor 
                        navigationMethod="byURL"
                        navigationMode="0"/>
                </nav:ifNotNavNodeEqualsLaunchedNavNode>
                </li>
            </nav:iterateRelatedNavNodes>
            </ul>
        </nav:ifNavNodeHasRelatedNavNodes>
    </nav:contextNavNode>
    
End of the code.