forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mickael Remond <>
Subject Re: Problem with site.xml and menu for hidden items
Date Fri, 29 Jul 2005 17:25:24 GMT
Ross Gardler wrote:
> Let us know if you get anywhere, a patch would be welcome if you make 
> this work.

Hello again,

Here is how I solved the problem. This is not a perfectly clean hack but 
it works for me ;-)
I used this piece of site.xml code:
       <release type="leaf" label="Release notes" href="releases/"
                description="Latest release notes">
         <index type="hidden" label="Release notes" href="index.html"/>
         <release2 type="hidden" label="Release 0.9.1"
         <release1 type="hidden" label="Release 0.9"

The "hidden" element are properly placed in the site hierarchy, whereas 
element with no label are ignored.
Then I use the type tag to force the rendering of elements that would be 
considered as menu to menu-item (clickable). The element is thus render 
as a "leaf", while having children element (all are hidden).

And I had to modify the file 
/src/core/context/resources/stylesheets/site2book.xsl to:

   <xsl:template match="*/*">
       <!-- No label, abandon the whole subtree -->
       <xsl:when test="not(@label)">
       <!-- Below here, everything has a label, and is therefore 
considered "for display" -->

       <!-- No children -> must be a menu item -->
       <!-- Has children, but they are not for display -> menu item -->
       <xsl:when test="count(*) = 0 or count(*) > 0 and (not(*/@label))">
           <xsl:copy-of select="@*"/>
       <xsl:when test="@type='leaf'">
             <xsl:copy-of select="@*"/>
       <!-- Anything else is considered a menu -->
           <xsl:copy-of select="@*"/>

I have only added the "leaf" test, in this piece of code.

On problem remains, that I will solve later: The forced leaf element is 
not rendered as selected when I select it directly. It should not be 
hightlighted when a hidden child is selected however.
An example result is here:

I will fix that after the vacation break.

Thank you all for your help.

Mickaël Rémond

View raw message