AW: [opencms-dev] How to Create a navigation menu

Kai Schliemann schliemann at comundus.com
Mon Feb 19 12:03:42 CET 2007


Hi,
check, if you chose the correct site in the site select box (e.g.
"sites/default").
Regards
Kai
  -----Ursprüngliche Nachricht-----
  Von: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org]Im Auftrag von mohamed hadj taieb
  Gesendet: Montag, 19. Februar 2007 11:31
  An: The OpenCms mailing list
  Betreff: [opencms-dev] How to Create a navigation menu


  Hi i want to create a navigation menu with OpenCMS by using this code

  ########################### menu code ##########
  <%@ page session="false"

  import="java.util.Iterator,

  java.util.List,

  org.opencms.jsp.CmsJspNavBuilder,

  org.opencms.jsp.CmsJspNavElement,

  org.opencms.jsp.CmsJspActionElement"

  %>

  <%

  /*

  * Provides basic site navigation.

  */

  // Create the class from which we will get navigation.

  CmsJspActionElement cms =

  new CmsJspActionElement( pageContext, request, response );

  // Get navigation info

  CmsJspNavBuilder navigation = cms.getNavigation();

  List navItems = navigation.getNavigationForFolder();

  Iterator i = navItems.iterator();

  // Loop through all of the items in the ArrayList and print the

  // menu.

  while( i.hasNext() ) {

  CmsJspNavElement navElement = ( CmsJspNavElement )i.next();

  String link = cms.link( navElement.getResourceName() );

  String title = navElement.getTitle();

  out.println("»<a href=\"" + link + "\">" + title + "</a><br/>");

  }

  %>

  ########################### end menu code ######

  when testing i dont get nothing in the content of the menu
  i cheked the value of the bolean : i.hasnext() i found it false and i don
t understand why

  if someone have an idea about the problem or have an other example to
create a menu i will be grateful for his help

  Cordially
  Mohamed HADJ TAIEB


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070219/43bcf95b/attachment.htm>


More information about the opencms-dev mailing list