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

Ivan Biddles ivanb at scientology.net
Mon Nov 4 20:39:42 CET 2002


Hi Paul and Bruno,

I am fairly new to OpenCms. I too want to show a breadcrumb on a single
line on each page, but when I use getNavParent, instead of:

      RootFolder | Level2Folder | Level3Folder | Level3ItemA

I end up with the navigation from the current folder.

      Level3ItemA | Level3ItemB | Level3ItemC |

If I supply getNavParent with a parameter of 2, to force it to start to
levels up (the root of my project), I get.

      Level2FolderA | Level2FolderB | Level2FolderC |  etc.

If I supply a parameter of, say 10, to force it to start from the root I
get.

      Background | Service | HomePage |    (i.e. OpenCms items)

I made your change to the extractFolder method, but still no luck.

There is obviously something I don't understand about this, so any
pointers would be highly appreciated.

Best wishes,
              Ivan

------------------------------------------------------------------------
-
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