You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Ross Gardler <rg...@wkwyw.net> on 2003/12/21 04:28:03 UTC

Multiple tab.xml files

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.

Ross


Re: Multiple tab.xml files

Posted by Ross Gardler <rg...@wkwyw.net>.
Johan Kok wrote:
> Nicola Ken Barozzi wrote:
> 
> 
>>> 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. 
>>  
>>
> 
> Should we not split  navigation, including tabs (and their respective 
> logic flow),  from the skin? IMHO the skin should contain any processing 
> logic, merely what the name says, a skin or dress-up over what exists 
> already, i.e. look and feel.

That's what I understodd Nicola Ken to be saying, the skin would merely 
be saying "this is a link in the menu" and "this is a link in a tab" - 
this is still presentation, the functionality of the link doesn't change.

Ross


Re: Multiple tab.xml files

Posted by Johan Kok <jk...@messianic.dyndns.org>.
Nicola Ken Barozzi wrote:


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

Should we not split  navigation, including tabs (and their respective 
logic flow),  from the skin? IMHO the skin should contain any processing 
logic, merely what the name says, a skin or dress-up over what exists 
already, i.e. look and feel.


Johan Kok



>

Re: Multiple tab.xml files

Posted by Ross Gardler <rg...@apache.org>.

Juan Jose Pablos wrote:
> Ross,
> 
> Ross Gardler wrote:
> 
>>
>> I have made this work in my skin. You can see a demo at 
>> http://courses.gardler.org/testing. The home page has only a single 
>> level of tabs, clicking on the "IB661 - MIS" tab will give you a 
>> second level of tabs 
>> (http://courses.gardler.org:8080/testing/courses/MIS/index.html).
>>
>> Shall I take the time to put this into the other skins? It could 
>> probably do with a little work on the display side of things but the 
>> basic functionality is there and it looks reasonable.
>>
>> NB it *is* backward compatible, so there is no-one is forced to use it.
>>
>> Ross
> 
> 
> 
> I have not been able to see this, but could you explain a bit, what is 
> the diferent for a tab and a horizontal menu?

OK something seems to have gone wrong with the demo. I'll have to check 
this out as it seems to be a problem with the webapp running under jetty 
- but no time now. Anyway, it is now included in CVS head so you can 
look at it if you have cvs head.

In short the second level of tabs is kind of like a horizontal menu. 
When you select a tab all the second level tabs related to that tab are 
displayed. So:

<tab label="A" dir="...">
   <tab label="1" dir="..">
   <tab label="2" dir="..">
   <tab label="3" dir="..">
</tab>

<tab label="B" dir="...">
   <tab label="4" dir="..">
   <tab label="5" dir="..">
   <tab label="6" dir="..">
</tab>

Will display something like:

*A*     |     B
---------------------------
*1*   |    2    |    3

When tab A is selected and you are at page/tab 1.

Since the tab file now starts to look like a site.xml file it has been 
suggested that we no longer need the tabs.xml file and it can be 
generated from the tab.xml file instead. A discussion regarding this has 
just begun in the thread "Re: tabs.xml into site.xml"

Ross


Re: Multiple tab.xml files

Posted by Juan Jose Pablos <ch...@che-che.com>.
Ross,

Ross Gardler wrote:
> 
> I have made this work in my skin. You can see a demo at 
> http://courses.gardler.org/testing. The home page has only a single 
> level of tabs, clicking on the "IB661 - MIS" tab will give you a second 
> level of tabs 
> (http://courses.gardler.org:8080/testing/courses/MIS/index.html).
> 
> Shall I take the time to put this into the other skins? It could 
> probably do with a little work on the display side of things but the 
> basic functionality is there and it looks reasonable.
> 
> NB it *is* backward compatible, so there is no-one is forced to use it.
> 
> Ross


I have not been able to see this, but could you explain a bit, what is 
the diferent for a tab and a horizontal menu?
Cheers,
Cheche


Re: Multiple tab.xml files

Posted by Johan Kok <jk...@messianic.dyndns.org>.
Love the additional tab functionality....

Ross Gardler wrote:

> Ross Gardler wrote:
>
>>> Nicola Ken Barozzi wrote:
>>
>
> <snip/>
>
>>> 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"
>>>     xmlns:xlink="http://www.w3.org/1999/xlink">
>>>
>>>     <tab id="home" label="Home" dir="">
>>>       <tab id="a" label="A" dir="a"/>
>>>     </tab>
>>>     <tab id="community" label="Community" dir="community"/>
>>>     <tab id="howto" label="How-to" dir="community/howto">
>>>       <tab id="b" label="B" dir="b"/>
>>>     </tab>
>>>
>>>  </tabs>
>>>
>>> As long as we are able to filter //tab/tab elements, also old skins 
>>> should work, and the new ones can use subtabs.
>>
>
> I have made this work in my skin. You can see a demo at 
> http://courses.gardler.org/testing. The home page has only a single 
> level of tabs, clicking on the "IB661 - MIS" tab will give you a 
> second level of tabs 
> (http://courses.gardler.org:8080/testing/courses/MIS/index.html).
>
> Shall I take the time to put this into the other skins? It could 
> probably do with a little work on the display side of things but the 
> basic functionality is there and it looks reasonable.
>
> NB it *is* backward compatible, so there is no-one is forced to use it.
>
> Ross
>
>
>


Re: Multiple tab.xml files

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Ross Gardler wrote:
> Ross Gardler wrote:
> 
>>> Nicola Ken Barozzi wrote:
> 
> <snip/>
> 
>>> Instead of recreating a new file we can easily extend the current 
>>> tabs.xml, and this *should* make it backward compatible:
...
> 
> I have made this work in my skin. You can see a demo at 
> http://courses.gardler.org/testing. The home page has only a single 
> level of tabs, clicking on the "IB661 - MIS" tab will give you a second 
> level of tabs 
> (http://courses.gardler.org:8080/testing/courses/MIS/index.html).

Cool. Needs a bit of skin tweaking though, but it's nice to have this 
extra functionality.

For example, I never decided how to use tabs on teh top, if to show 
project resources like CVS, mailing lists, downloads, etc or more 
semantical site sections. With subtabs it's much better.

> Shall I take the time to put this into the other skins? It could 
> probably do with a little work on the display side of things but the 
> basic functionality is there and it looks reasonable.
> 
> NB it *is* backward compatible, so there is no-one is forced to use it.

Ok for me, send it in. If you could make it patch the krysalis-site skin 
it would be swell, but also a simple dump of what you use should do.

I already have a place in the tigris-style skin waiting for it too. :-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: Multiple tab.xml files

Posted by Ross Gardler <rg...@wkwyw.net>.
Ross Gardler wrote:
>> Nicola Ken Barozzi wrote:

<snip/>

>> 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"
>>     xmlns:xlink="http://www.w3.org/1999/xlink">
>>
>>     <tab id="home" label="Home" dir="">
>>       <tab id="a" label="A" dir="a"/>
>>     </tab>
>>     <tab id="community" label="Community" dir="community"/>
>>     <tab id="howto" label="How-to" dir="community/howto">
>>       <tab id="b" label="B" dir="b"/>
>>     </tab>
>>
>>  </tabs>
>>
>> As long as we are able to filter //tab/tab elements, also old skins 
>> should work, and the new ones can use subtabs.

I have made this work in my skin. You can see a demo at 
http://courses.gardler.org/testing. The home page has only a single 
level of tabs, clicking on the "IB661 - MIS" tab will give you a second 
level of tabs 
(http://courses.gardler.org:8080/testing/courses/MIS/index.html).

Shall I take the time to put this into the other skins? It could 
probably do with a little work on the display side of things but the 
basic functionality is there and it looks reasonable.

NB it *is* backward compatible, so there is no-one is forced to use it.

Ross


Re: Multiple tab.xml files

Posted by Ross Gardler <rg...@wkwyw.net>.
Nicola Ken Barozzi wrote:

> It has been intentional [only one set of tabs per site]. Tabs should never change during navigation, 
> it's confusing.
> 
> What you may want instead are hierarchical tabs, as seen here:
> http://www.oreillynet.com/

OK I see the value in this.

> 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"
>     xmlns:xlink="http://www.w3.org/1999/xlink">
> 
>     <tab id="home" label="Home" dir="">
>       <tab id="a" label="A" dir="a"/>
>     </tab>
>     <tab id="community" label="Community" dir="community"/>
>     <tab id="howto" label="How-to" dir="community/howto">
>       <tab id="b" label="B" dir="b"/>
>     </tab>
> 
>  </tabs>
> 
> As long as we are able to filter //tab/tab elements, also old skins 
> should work, and the new ones can use subtabs.

+1

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

I see a couple of problems with this, but as you say it's a big thing 
overall, so I'll keep them to myself for now.

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

I'll have a go at it ove rthe holidays when I'm board of writing 
(happens alot :-)

I've also tidied up my code to make dynamic webapps work again, I'll 
post a patch as soon as I get some decent bandwidth later today.

Ross


Re: Multiple tab.xml files

Posted by Nicola Ken Barozzi <ni...@apache.org>.
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:
http://www.oreillynet.com/

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"
     xmlns:xlink="http://www.w3.org/1999/xlink">

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

  </tabs>

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                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: Multiple tab.xml files

Posted by Ross Gardler <rg...@wkwyw.net>.
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.

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>

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

Ross