[opencms-dev] Opencms 6 Navigation Issue...

Claus Priisholm cpr at codedroids.com
Sat Jul 8 14:49:09 CEST 2006


There is a getNavigationForFolder("/department") which gives you the 
list of navigation elements inside the folder, but maybe you are looking 
for the navigation info for the folder itself?
In that case you can use it on the parent folder ("/") and perhaps use a 
special property on the departsments to set them apart from other 
entries at the root level. Or you can simply use the 
getNavigationForResource("/department") to get the navigation element 
for that specific folder (and the other three hardcoded folders) - in 
relation to your code example you could then add the elements to a list 
and basically do exactly as you do in your code (from the Iterator 
i=list.iterator and on)



Colin Coolidge wrote:
> I'm trying to change the code below to "hard code" static folders for 
> navigation elements.Right now I'm using:
>  
> ___________________________________
>  
> <%@ 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("");
>  
> while (i.hasNext()) {
>     org.opencms.jsp.CmsJspNavElement ne = 
> (org.opencms.jsp.CmsJspNavElement)i.next();
>     out.println("<a class=\"menuItem\" href=\"" + 
> cms.link(ne.getResourceName()) + "\">");
>     out.println(ne.getTitle() + " ");
>     out.println("</a>");
> }   
> out.println("");
> %>
>  
> ________________________________________
>  
> to make a navigation of the current folder. I would like to use some 
> like the *getNavigationforResource()* function to hard code in 4 
> specific folders. IE: something like this.. 
> *getNavigationforResource(/sites/default/parksandrecreation/) * . 
> Basically I'm making top nav pulldown menus dynamically with the 
> getNavigation stuff and have four hard coded departments.
>  
> PS: I've been looking through the Alkon docs and really need a sample of 
> the syntax.
>  
> thanks!
> 
> ------------------------------------------------------------------------
> Yahoo! Music Unlimited - Access over 1 million songs. Try it free. 
> <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/ 
>  >
> 
> 
> ------------------------------------------------------------------------
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev

-- 
Claus Priisholm, CodeDroids ApS
Phone: +45 48 22 46 46
cpr (you know what) codedroids.com - http://www.codedroids.com
cpr (you know what) interlet.dk - http://www.interlet.dk
--
Javadocs and other OpenCms stuff: 
http://www.codedroids.com/community/opencms



More information about the opencms-dev mailing list