[opencms-dev] Can we generate the Bread Crumb in opencms

CALI-GARSIA Bruno bruno.cali-garsia-renexter at renault.com
Tue Oct 1 10:39:51 CEST 2002


Hi Paul,

I had this pb with OpenCms 4.4.6 and found it was coming from the method
exractFolder in com.opencms.defaults.CmsXmlNav.


in the method extractFolder() :
....
while (st.hasMoreTokens()) {
		//-->>>> replaced ">" with ">=" <<<<<--
            if (level>=1) {
                currentFolder=currentFolder+st.nextToken()+"/";
                level--;
            } else {
                break;
            }
        }
....

Try to extends CmsXmlNav and overwrite extractFolder with the correction
above, it should work.

Note it solved the pb for the method getParent(), I didn't test all other
navigation methods for regression after the change.

regards,
Bruno






-----Message d'origine-----
De : owner-opencms-dev at www.opencms.org
[mailto:owner-opencms-dev at www.opencms.org]De la part de Paul Armstrong
Envoyé : mardi 1 octobre 2002 02:27
À : opencms-dev at www.opencms.org
Cc : rbkannan at yahoo.com
Objet : [opencms-dev] Can we generate the Bread Crumb in opencms


Hi,

Has anyone recently implemented breadcrumbs in an OpenCMS installation ?

I've got it working, but so far only with two levels of nested navigation.

I'm trying to use getFolderParent to iterate up through the navigation tree
in order to build the breadcrumbs.

I've got "Level 1", "Level 2", "Level 3" nav.

When calling getFolderParent from a page within "Level 3" with either
'blank' or '0' as the argument I get the parent to be Level 3 which is
correct.

However when I call it with '1' as the argument I get "Level 1" not "Level
2" as I would expect. "Level 3" seems to think it's parent is "Level 1".

Has anyone come across this problem and found a solution ?

If not, has anyone implemented breadcrumbs in a way other than using
getFolderParent ?

Any help would be much appreciated.


Thanks,

Paul




More information about the opencms-dev mailing list