forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [POLL] Full vs. truncated menus
Date Fri, 07 Feb 2003 22:48:57 GMT
Jeff Turner wrote:


>Ideally, the final menu2html.xsl stylesheet should be given the *entire*
>site menu structure, with a 'you are here' marker attribute, and be left
>to render whatever subset of the menu makes sense.  If someone implements
>a snazzy CSS/JS click-to-open menu, then menu2html.xsl would populate the
>data structure with all the data.

I think it's time for me go out from lurking on this list, as this is 
exactly what I did for a small home-grown demo. I didn't had time when I 
needed that demo to dig in Forrest (shame on me), but you may find here 
some useful ideas.

Basically, the purpose was to produce navigation and decoration on a 
hole site composed of a hierarchy of "content" HTML pages. By content, I 
mean that the directory structure reflects the navigation tree, and that 
HTML is not styled. No xdoc DTD, no book.xml to update : just start 
Mozilla composer, write your stuff in wysiwyg mode, save it a the right 
place and it automagically appears in the navigation.

The navigation tree is obtained by traversing the whole tree (directory 
generator), and getting the<title> tag of every HTML file, which becomes 
the menu entry for that page.

This navigation tree is correlated with the requested URI so that parent 
directories are marked as "in path" and the current page as "requested". 
This allows to display in the tree only the ancestors of the current 
page and their siblings, along with the immediate children of the 
current page. This also allows to easily get the path to the current 
page (breadcrumb ?).

As far as layout is concerned, I wrote what I call a "button-engine" 
which produces SVG labels with shiny gradients for first-level 
directories. Each first-level directory has an associated color that 
drives the button rendering and the menu background. This makes it easy 
to know in which part of the site you are.

The main problem I encountered is caching : the DirectoryGenertor being 
not cacheable, the whole tree was traversed and analyzed at each 
request, leading to hair-pulling response times. So I hacked a version 
that reloaded the tree every "x" seconds, and recently changed it so it 
_checked_ the tree every "x" seconds. This results in very smooth 
operation while still allowing dynamic update.

Ah, and I also wrote once a fold/unfold menu with a few lines of JS and 
ids ;-)

Tell me if all this is of interest, and I'll package something so you 
can pick whatever you find good in it.

Finally :

[X] The menu should be limited to files below the current directory
[ ] The menu should display all files in the site


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message