[opencms-dev] Issue with getNavigationForFolder
David Seikel
david.seikel at icemedia.com.au
Mon Jun 16 02:04:01 CEST 2003
Nicolas Delsaux wrote:
> cms.getNavigation().getNavigationForFolder(uri); (where URI is
> cms.getRequestContext().getUri();) to get all the files in a directory.
> And unfortunatly, I get all my site hierarchy. Of course, it gives me an
> easy site map, but it's obviously not what I want. In fact, I would
> prefer to see getNavigationForFolder behave as expected.
> I've removed the recursive part, and the list I get is the root list.
> Can someone explain me why I have this strange issue ?
It might be related to a similar problem I am having with getNavRoot().
I want the navigation template to display links to the contents of the
current folder, but if I do it wrong I get the previous folder, or the
root folder.
It works fine for every file except for the index file, where I get
different results depending on wether it is called index.html or
index.jsp. Since I am not using JSP, it doesn't really matter what I
call it, but you are using JSP, so you probably cannot rename your index
files. To get it to work as advertised, the index page has to be called
index.html in the leaf nodes, and index.jsp everywhere else. For
example with a directory structure like this -
project
sub1
sub2
sub2_1
sub2_2
I need to have these index files for it all to work -
project/index.jsp
project/sub1/index.html
project/sub2/index.jsp
project/sub2/sub2_1/index.html
project/sub2/sub2_2/index.html
They all use the same template for the navigation element. While I am
developing this, it is fine as I can keep track of this and change the
names as needed (adding a new folder inside sub2_1 would require a name
change for project/sub2/sub2_1/index.html). But we hand this over to
the client soon, and they may want to add sub folders, and when they do
the navigation will break.
I experimented with various ways of getting the navigation to work, and
they all seemed to have the same problem.
More information about the opencms-dev
mailing list