[opencms-dev] sample code getNavigationBreadCrumb

Josso.Relota at mbcac.Mercedes-Benz.com Josso.Relota at mbcac.Mercedes-Benz.com
Wed Jan 28 14:43:01 CET 2004


Hi,
 
Here is sample code for using the getNavigationBreadCrumb method in version
5.0.1
 
Regards 
Josso
 
com.opencms.file.CmsObject cmsObject = cms.getCmsObject();
String uri = cmsObject.getRequestContext().getUri();
CmsJspNavElement currentnav =
CmsJspNavBuilder.getNavigationForResource(cmsObject, uri);
String currentfolder = currentnav.getParentFolderName();
ArrayList Crumbslist =
cms.getNavigation().getNavigationBreadCrumb(currentfolder, 2, -1, true);
Iterator t = Crumbslist.iterator();
 
while (t.hasNext()) {
            CmsJspNavElement nav1 = (CmsJspNavElement)t.next();
            String target1 = nav1.getResourceName();
            if (nav1.isFolderLink()) {
                        target1 = cms.link(target1 + "index.html");
 
}
            %>
            <a href="<%= target1 %>"><%= nav1.getNavText() %></a> >
            <%       
                                                            }
            %>
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040128/ba001c9e/attachment.htm>


More information about the opencms-dev mailing list