[Zope] ``Context sensitive'' table cells

Carsten Wartmann cw@imago-viva.de
Tue, 19 Oct 1999 23:58:05 +0200 (CEST)


Ramiro Brito Willmersdorf writes:
 > 
[···]
 > Again, as a lot of other people seem to be doing these days, I built a menu
 > structure using tables.  I'd like to have the background color of the cell that
 > has been selected to change to a different color, to reflect where in the site
 > you are at the moment.  I came up with the ``code'' below:
[···]
 > In the index_html documento in each folder mentioned in the 
 > anchor tag, I have set the title to the string I'm using the comparison.
[···]
 > So, I'd like to ask if there is a nicer cleaner way of doing what I wanted to
 > in the first place (ie, changing the background color of one particular table
 > cell depending on which folder is being currently viewed), or alternatively
 > how can I write a DTML method with an argument, to avoid repeating all those
 > <dmtl-if>'s.

I tried something similar, I changed a title graphic with a method:

Method "Title":
[··· Table with the titlegraphic ···]
 <td colspan="1"><img src="gfx/<dtml-var thema>.gif" width="221" height="37"></td>
[···]

On my pages I insert the title-table with:

[···]
  <!--#call "REQUEST.set('thema','Links')"-->
  <dtml-var Titel> 
[···]

I think you can adapt this.

To the Gurus: How has the call to look?

I tried a bit but I´m too new to dtml and Zope.

Carsten.