[Zope] tabs interface for user pages

Joachim Werner joe@iuveno-net.de
Wed, 15 Aug 2001 20:49:56 +0200


> I would greatly, and urgently (demo Friday!) appreciate any
> suggestions on how to incorporate (flexible) tab views into my site
> pages.  Do I need to create a subclass of Tabs?  Do I need to define
> my own versions of various dtml methods used by manage_tabs?  Is
> there a product that does something like this, either that I could
> use or that I could learn from?
>
> I can't be the first person to want this!?!

I think you are on the right way. You can use the manage_tabs part as a
start. If you create your own management pages, using the DTML Methods like
in the examples of "main.dtml" or so in your own code should do the job. If
you want tabs in your "normal" web pages, you will have to provide a
different source of "tabs", e.g. you could have a folder of all the pages to
be displayed and iterate over it, or provide a list property with all the
tab names.

See this rather complicated code from Kontentor
(http://demo.iuveno-net.de/iuveno/Products/Kontentor/Demo) for help. It
needs a list called "tabs" and all the color variables set to do its job:

<table width="0%" border="0" cellspacing="1" cellpadding="4"
bgcolor="#000000" class="bodytext" height="23">
 <tr>
  <dtml-in tabs>
   <dtml-let tab=sequence-item>
    <dtml-call "REQUEST.set('tab_id',id)">
    <dtml-in PARENTS>
     <dtml-if "tab==id">
      <dtml-call "REQUEST.set('tab_id',tab)">
     </dtml-if>
    </dtml-in>
    <dtml-if "tab==tab_id">
     <td class="tabtextactive" bgcolor="<dtml-var chosen_tab_bgcolor>">
      <dtml-with "_[tab]">
       <center><dtml-var page_title></center>
      </dtml-with>
     </td>
    <dtml-else>
     <td bgcolor="<dtml-var tab_bgcolor>">
      <dtml-with "_[tab]">
       <center><a class="tabtext" href="<dtml-var absolute_url>"><dtml-var
page_title></a></center>
      </dtml-with>
     </td>
    </dtml-if>
   </dtml-let>
  </dtml-in>
 </tr>
</table>


Joachim