<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=800275510-19022007><FONT face=Arial color=#0000ff
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=800275510-19022007><FONT face=Arial color=#0000ff size=2>check,
if you chose the correct site in the site select box (e.g.
"sites/default").</FONT></SPAN></DIV>
<DIV><SPAN class=800275510-19022007><FONT face=Arial color=#0000ff
size=2>Regards</FONT></SPAN></DIV>
<DIV><SPAN class=800275510-19022007><FONT face=Arial color=#0000ff
size=2>Kai</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Ursprüngliche Nachricht-----<BR><B>Von:</B>
opencms-dev-bounces@opencms.org [mailto:opencms-dev-bounces@opencms.org]<B>Im
Auftrag von </B>mohamed hadj taieb<BR><B>Gesendet:</B> Montag, 19. Februar
2007 11:31<BR><B>An:</B> The OpenCms mailing list<BR><B>Betreff:</B>
[opencms-dev] How to Create a navigation menu<BR><BR></FONT></DIV>
<DIV>Hi i want to create a navigation menu with OpenCMS by using this code
</DIV>
<DIV> </DIV>
<DIV>########################### menu code ##########</DIV>
<DIV><FONT size=1>
<P><%@ page session="false" </P>
<P>import="java.util.Iterator, </P>
<P>java.util.List, </P>
<P>org.opencms.jsp.CmsJspNavBuilder, </P>
<P>org.opencms.jsp.CmsJspNavElement, </P>
<P>org.opencms.jsp.CmsJspActionElement" </P>
<P>%> </P>
<P><% </P>
<P>/* </P>
<P>* Provides basic site navigation. </P>
<P>*/ </P>
<P>// Create the class from which we will get navigation. </P>
<P>CmsJspActionElement cms = </P>
<P>new CmsJspActionElement( pageContext, request, response ); </P>
<P>// Get navigation info </P>
<P>CmsJspNavBuilder navigation = cms.getNavigation(); </P>
<P>List navItems = navigation.getNavigationForFolder(); </P>
<P>Iterator i = navItems.iterator(); </P>
<P>// Loop through all of the items in the ArrayList and print the </P>
<P>// menu. </P>
<P>while( i.hasNext() ) { </P>
<P>CmsJspNavElement navElement = ( CmsJspNavElement )i.next(); </P>
<P>String link = cms.link( navElement.getResourceName() ); </P>
<P>String title = navElement.getTitle(); </P>
<P>out.println("»<a href=\"" + link + "\">" + title +
"</a><br/>"); </P>
<P>} </P>
<P>%> </P></FONT></DIV>
<DIV>########################### end menu code ######</DIV>
<DIV> </DIV>
<DIV>when testing i dont get nothing in the content of the menu </DIV>
<DIV>i cheked the value of the bolean : i.hasnext() i found it false and i don
t understand why </DIV>
<DIV> </DIV>
<DIV>if someone have an idea about the problem or have an other example to
create a menu i will be grateful for his help</DIV>
<DIV> </DIV>
<DIV>Cordially</DIV>
<DIV>Mohamed HADJ TAIEB</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></BLOCKQUOTE></BODY></HTML>