[Zope] <dtml-if> and <dtml-var> question
complaw@hal-pc.org
complaw@hal-pc.org
Thu, 12 Oct 2000 21:24:11 GMT
First, thanks for the help these last several days. I'm glad to report that I
have a useful Zope site up and running that is the envy of the law firm.
Now its time to get a little fancy. Unfortunately, after having read the DTML
Reference, and the Zope Quick Reference, I still haven't been able to figure out
how to get today's date into a dtml-var. Case in point:
I want to put a table of dates and hyperlinks. If the day has already passed, I
want to shade the table cell (<td bgcolor="gray">). In this case, the object
has a date property called event_date.
<table>
<tr>
<dtml-if expr="event_date < DateTime()">
<td bgcolor="gray">
<dtml-else>
<td bgcolor="white">
</dtml-if>
</td>
</table>
The above code gives me a NameError.
Another example would be to simply get the integer value of the year so that it
can be included in a copyright statement. E.g.,
Copyright © <dtml-var Year()>, All rights reserved.
Unfortunately, this doesn't work either.
Can someone point me in the right direction?