[opencms-dev] oops Fix Answer to Bread Crumbs

Alexander Kandzior alex at opencms.org
Fri Jul 18 10:35:01 CEST 2003


Btw. bread crump navigation is also implemented as a default method in
the current CVS CmsJspNavBuilder method, i.e. it will be available in
future OpenCms releases by default. 

To see how this is done, check out:
http://www.opencms.org/cvs/viewcvs.cgi/opencms/src/com/opencms/flex/jsp/
CmsJspNavBuilder.java

The method name is:
public ArrayList getNavigationBreadCrumb(...)

This will be available with the next update.

Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com


> -----Original Message-----
> From: opencms-dev-admin at opencms.org 
> [mailto:opencms-dev-admin at opencms.org] On Behalf Of Pucky Loucks
> Sent: Friday, July 18, 2003 12:39 AM
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] oops Fix Answer to Bread Crumbs
> 
> 
> Sorry had to swap some code around. This works great.
> 
> <%@ page session="false"  
> import="com.opencms.flex.jsp.*,com.opencms.file.*" %>
> <%
> 
>      com.opencms.flex.jsp.CmsJspActionElement cms = new  
> CmsJspActionElement(pageContext, request, response);
>      com.opencms.flex.jsp.CmsJspNavBuilder cmsnav = 
> cms.getNavigation();
>      java.lang.StringBuffer mystring = new StringBuffer("");
> 
>      String rootFolder = "/myrootweb/";  //just change this 
> to your root  
> folder
>      String thisFolder = cms.getRequestContext().getFolderUri();
>      String thisFile = cms.getRequestContext().getFileUri();
>      String name;
>         if(!thisFile.equalsIgnoreCase("index.html"))
>            mystring.insert(0,"  /  <a class='breadcrumb' href='" +  
> cms.link(thisFolder + thisFile) + "'>"+ thisFile +"</a></p>");
>      while(true)
>      {
>        if(rootFolder.equalsIgnoreCase(thisFolder))
>           break;
>      name =  
> cms.getNavigation().getNavigationForResource(thisFolder).getNavText();
>      mystring.insert(0,"  /  <a class='breadcrumb' href='" +  
> cms.link(thisFolder) + "'>" + name  + "</a>");
>      thisFolder =  
> cms.getNavigation().getNavigationForResource(thisFolder).getPa
> rentFolder 
> Name();
>      }
>      mystring.insert(0,"<p class='breadcrumbstring'><a  
> class='breadcrumb' href='" + cms.link(rootFolder) + "'>Home</a>");
>      out.print(mystring.toString());
> %>
> 
> Pucky Loucks
> Senior Systems Architect
> How2Share Technologies Inc.
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 




More information about the opencms-dev mailing list