[Zope] How do I use "or" (|) with <dtml-if>
Harry Henry Gebel
hgebel@inet.net
Mon, 15 Nov 1999 01:51:06 +0000
I have the following code for setting up colors:
<dtml-if BGCOLOR>
<STYLE type="text/css">
BODY { background: <dtml-var BGCOLOR> }
</STYLE>
</dtml-if>
<dtml-if VLINK>
<STYLE type="text/css">
A:visited { color=<dtml-var VLINK> }
</STYLE>
</dtml-if>
I would like to have something like this:
<dtml-if BGCOLOR | VLINK>
<STYLE type="text/css">
<dtml-if BGCOLOR>
BODY { background: <dtml-var BGCOLOR> }
</dtml-if>
<dtml-if VLINK>
A:visited { color=<dtml-var VLINK> }
</dtml-if>
</STYLE>
</dtml-if>
Since this would eliminate having an extra STYLE tag. When expanded to
include all the various optional tags that could be included this could
save alot of space. However, I can not figure out how to use an "or"
with dtml-if. I have not got that good of a handle on using python
expressions with dtml, I assume this will be necessary. Of course, I
could just take the <STYLE></STYLE> tags outside of any dtml-if, but
this would leave an empty STYLE element in alot of pages which is
aesthetically displeasing to me, although that is what I will do if I
can't figure out a better way. Can anyone help me with this problem?
----------------------------------------------------------------------
Harry Henry Gebel ICQ# 43675297
West Dover Hundred, Delaware
----------------------------------------------------------------------