[Zope] ``Context sensitive'' table cells

Ethan Fremen mindlace@majordomo.net
Tue, 19 Oct 1999 18:28:45 +0100


Ramiro Brito Willmersdorf wrote:

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

Assign each of the table cells an ID, and your TABLE a class (navbar).
Then, if you do a site wide css-sheet, add this inside the <HEAD> of
your standard_html_footer:
<dtml-var style_sheet>

and style sheet would look something like this:

<STYLE TYPE="text/css">
<!-- /* Hide content from old browsers */

.navbar TD { background-color: orange; }

<dtml-if here_css><dtml-var here_css></dtml-if>
/* end hiding */ -->

and then in your here_css, which goes in the folder you want to be the
"titulo" section.

TD#Titulo { background-color: blue; }

So, this would make the background chage from orange to blue when you
were in the right area.

In fact, I think I'll go implement this on my site :-)

-- 
     mindlace
                  Disclaimer: Any use of this email, in any manner
whatsoever, will increase the amount of disorder in the universe. 
Although no liability is implied herein, the reader is warned that 
this process will ultimately lead to the heat death of the universe.