You are not logged in Log in Join
You are here: Home » Members » Greg's Zope Software » How to create tabs for user pages » DTML method to create user-defined tabs » View File

Log in
Name

Password

 

DTML method to create user-defined tabs

File details
Size
3 K
File type
text/plain

File contents

<dtml-comment>
    This method creats a list of tabs similar to the Zope management 
    interface.  The code below, is a slightly modified version of the 
    code in manage_tabs.dtml.   

    It should be called after creating (via dtml-let) a variable named
    'tabs' that contains a list of dictonaries, one for each tab.  Each
    dictonary should contain the elements 'label', 'action', and 'target'.
</dtml-comment>

<dtml-if tabs>

<dtml-call "REQUEST.set('n_', _.len(tabs)-1)">
<dtml-call "REQUEST.set('a_', 0)">

<table cellpadding="0" cellspacing="0" width="100%" border="0">

<tr>
  <td bgcolor="#000000" rowspan="5" width="10%" valign="bottom" 
   align="left">&nbsp;&nbsp;<img src="&dtml-BASEPATH1;/p_/sp" 
   width="2" height="1" alt="" />
  </td>
  <td bgcolor="#000000" colspan="<dtml-var "4 * (n_ + 1)">"><img 
   src="&dtml-BASEPATH1;/p_/sp" width="1" height="5" alt="" /></td>
</tr>

<tr>
<dtml-in tabs>
<dtml-if "_['sequence-index']==a_">
  <td bgcolor="#ffffff" rowspan="2" valign="top" 
   align="left"><img src="&dtml-BASEPATH1;/p_/ltab" width="5" 
   height="5" alt="" /></td>
  <td bgcolor="#ffffff"><img src="&dtml-BASEPATH1;/p_/sp"
   width="1" height="2" alt="" /></td>
  <td bgcolor="#ffffff" rowspan="2" valign="top" 
   align="right"><img src="&dtml-BASEPATH1;/p_/rtab" width="5" 
   height="5" alt="" /></td>
  <td bgcolor="#000000" rowspan="4"><img src="&dtml-BASEPATH1;/p_/sp"
 width="2" height="1" alt="" /></td>
<dtml-else>
  <td bgcolor="#efefef" rowspan="2" valign="top" 
   align="left"><img src="&dtml-BASEPATH1;/p_/ltab" width="5" 
   height="5" alt="" /></td>
  <td bgcolor="#efefef"><img src="&dtml-BASEPATH1;/p_/sp"
 width="1" height="2" alt="" /></td>
  <td bgcolor="#efefef" rowspan="2" valign="top" 
   align="right"><img src="&dtml-BASEPATH1;/p_/rtab" width="5" 
   height="5" alt="" /></td>
  <td bgcolor="#000000" rowspan="4"><img src="&dtml-BASEPATH1;/p_/sp"
 width="2" height="1" alt="" /></td>
</dtml-if>
</dtml-in>
</tr>
<tr>

<dtml-in tabs mapping>
<dtml-if "_['sequence-index']==a_">
  <td bgcolor="#ffffff" valign="bottom" class="tab-small" 
   align="center"><font face="Verdana, Arial, Helvetica" 
   size="1" color="#000000">&nbsp;<a <dtml-if 
   action>href="&dtml-action;"<dtml-else>href="&dtml-URL1;"</dtml-if
   ><dtml-if target> target="&dtml-target;"</dtml-if
   >><span style="color: #000000;"><strong><dtml-var 
   label></strong></span></a>&nbsp;</font></td>
<dtml-else>
  <td bgcolor="#efefef" valign="bottom" class="tab-small" 
   align="center"><font face="Verdana, Arial, Helvetica" 
   size="1" color="#000000">&nbsp;<a <dtml-if 
   action>href="&dtml-action;"<dtml-else>href="&dtml-URL1;"</dtml-if
   ><dtml-if target> target="&dtml-target;"</dtml-if
   >><span style="color: #000000;"><strong><dtml-var 
   label></strong></span></a>&nbsp;</font></td>
</dtml-if>
</dtml-in>
</tr>
<tr>
<dtml-in tabs>
<dtml-if "_['sequence-index']==a_">
  <td colspan="3" bgcolor="#ffffff"><img src="&dtml-BASEPATH1;/p_/sp"
 width="2" height="1" alt="" /></td>
<dtml-else>
  <td colspan="3" bgcolor="#efefef"><img src="&dtml-BASEPATH1;/p_/sp"
 width="2" height="1" alt="" /></td>
</dtml-if>
</dtml-in>
</tr>
<tr>
<dtml-in tabs>
<dtml-if "_['sequence-index']==a_">
  <td colspan="3" bgcolor="#ffffff"><img src="&dtml-BASEPATH1;/p_/sp"
 width="2" height="1" alt="" /></td>
<dtml-else>
  <td colspan="3" bgcolor="#c0c0c0"><img src="&dtml-BASEPATH1;/p_/sp"
 width="2" height="1" alt="" /></td>
</dtml-if>
</dtml-in>
</tr>
</table>

<dtml-else>
<center>
(NO TABS DEFINED)
</center>
</dtml-if>