forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <>
Subject Re: Multiple tab.xml files
Date Sun, 21 Dec 2003 20:57:20 GMT
Ross Gardler wrote:

> Ross Gardler wrote:
>> I would like different tabs to appear in different directories on my 
>> site. For example, on the site home page I have tabs to each course 
>> offered, on a course page I have tabs to each module of a course.
>> Is this currently possible. If not are there any problems with me 
>> allowing a local tabs.xml file to take precedence over the root one. 
>> Kind of like book.xml overriding the site.xml file.

It has been intentional. Tabs should never change during navigation, 
it's confusing.

What you may want instead are hierarchical tabs, as seen here:

In this way we still have the same top-level tabs, but then the other 
ones below change when the top ones do.

> I've been experimenting with this whilst waiting for objects. There is a 
> problem - you have to include a tabs.xml file in all subdirectories, not 
> very manageable. So I have another proposal.
> If we have a tabGroups.xml file in the root folder, for example
> <tabGroups ...>
>   <group dir="">
>     <tab label="Site Home" dir="" indexfile="index.html"/>
>     <tab ... >
>     ...
>   </group>
>   <group dir="courses/cocoon/">
>     <tab label="Course Home" dir="courses/cocoon" indexfile="index.html"/>
>     <tab label="Flow" dir="courses/cocoon/flow" indexfile="index.html"/>
>   </group>
>   ...
> </tabGroups>

There, see that you have hierarchical tabs? ;-)

> We can then use that to create a tabs.xml file by using a stylesheet 
> (similar to site.xml being transformed into book.xml.
> If tabgroups.xml is absent then we revert to using tabs.xml so we have 
> backward compatability.
> I almost have this working (just a problem with deciding which tabs to 
> show, at the moment everything below the current directory gets shown, 
> so with the above if we are in "courses/cocoon" we would get both tab 
> groups.
> Is this a good addition to Forrest or shall I keep it within my own 
> customisation?>

Instead of recreating a new file we can easily extend the current 
tabs.xml, and this *should* make it backward compatible:

<tabs software="Forrest"
     title="Apache Forrest"
     copyright="2002-2003 The Apache Foundation"

     <tab id="home" label="Home" dir="">
       <tab id="a" label="A" dir="a"/>
     <tab id="community" label="Community" dir="community"/>
     <tab id="howto" label="How-to" dir="community/howto">
       <tab id="b" label="B" dir="b"/>


As long as we are able to filter //tab/tab elements, also old skins 
should work, and the new ones can use subtabs.

But let me add another question: are not tabs part of the site? Then why 
are they in a separate file?

My idea was to have top-level nodes of site.xml be the tabs, and a skin 
could decide at which level switch from tabs to navigation. As some 
pointed out, tabs are not necessarily containers of pages, but links to 
pages. Hence they have to remain in a separate hierarchy. This does not 
mean though that they have to be in a separate file.

The problem is that we already have a site.xml that needs tabs to be 
defined outside of the main element, so it would have to change. I would 
like to get this going later, as it's a big thing to do.

So for now making hierarchical tabs possible similarly to what we have 
now is a very good next step. (we'll have to add the functionality to 
our skins BTW)

In any case, hierarchical tabs should also cater for your need, as you 
can decide that your skin ignores to show top level tabs (not 
recommended IMHO).

Nicola Ken Barozzi         
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)

View raw message