<< Back - Alkacon logo

OpenCms 6.0 interactive documentation:

Documentation for the getNavigation() method

OpenCms logo - Forward >>

The getNavigation() method

This method returns an initialized CmsJspNavBuilder() instance. Please refer to the provided JavaDoc for a complete description of the org.opencms.jsp.CmsJspNavBuilder class.

With the methods provided by this class you can easily build your own navigations in JSP. The description of all options of the CmsJspNavBuilder() methods is outside the scope of this documentation.

Parameters:

This method has no parameters!

Example usage:

Build a navigation for the current folder:

<%@ page import="java.util.*" %><%   

// Create a JSP action element
org.opencms.jsp.CmsJspActionElement cms = new org.opencms.jsp.CmsJspActionElement(pageContext, request, response);

// Get a simple navigation of all pages / subfolders in the current folder
List list = cms.getNavigation().getNavigationForFolder();
Iterator i = list.iterator();

out.println("<h3>A simple sample navigation</h3>");
out.println("<p>Cache properties: <b>" + cms.property("cache","this") + "</b></p><ul>");
while (i.hasNext()) {
    org.opencms.jsp.CmsJspNavElement ne = (org.opencms.jsp.CmsJspNavElement)i.next();
    out.println("<li><a href=\"" + cms.link(ne.getResourceName()) + "\">");
    out.println(ne.getTitle() + "</a></li>");
}    
out.println("</ul>");
%>

©2003-2005 Alkacon Software (http://www.alkacon.com) - The OpenCms experts