[opencms-dev] getSiteNavigation does not work. Why????

Jesus Rodriguez rodpemail-opencms at yahoo.es
Thu Nov 18 11:24:51 CET 2004


Hi, I am trying to generate a menu navigation tree with all the pages of 
my website. I have typed the following code for that purpose:

<%@ page import="org.opencms.jsp.*" %>
<%   
     // Create a JSP action element
    CmsJspActionElement cms = new CmsJspActionElement(pageContext, 
request, response);
   
    // List of all pages / subfolders (sorted by NavPos property)
    java.util.List list = cms.getNavigation().getSiteNavigation();   
    java.util.Iterator i = list.iterator();

    // Now build the navigation
       
    while (i.hasNext()) {
        CmsJspNavElement ne = (CmsJspNavElement)i.next();
        out.println("<a href=\"" + cms.link(ne.getResourceName()) + 
"\">" + ne.getNavText() + "</a>");   
        out.println(ne.getNavTreeLevel());       
        if (i.hasNext()) {
            out.println("<br>");
        }
    }  
%>

The result it is only a blank screen. Why? I have tried to use the 
getNavigationTreeForFolder method whith the correct parameters of levels 
given by the getNavTreeLevel method and I have got only a list of the 
folders in the current level. I can't achieve to display the items of 
lower levels.

Would anybody help me? Thanks

JR



More information about the opencms-dev mailing list