DTML Basics (part 2) - Paring It Down (Page 6 of 8 )
In certain situations, youcan reduce the amount of code in your DTMLMethods by using the "unless" conditional test, which looks like this:
<dtml-unless condition>
do this!
</dtml-unless>
In this case, the statements in the "unless" block are only executed ifthe conditional statement evaluates to false. Consider the followingrewrite of an earlier example, which demonstrates:
<dtml-unless expr="name != 'neo'">
<font face="Arial" size="-1">
Welcome to the Matrix, Neo.
</font>
</dtml-unless>
Next: Deeper And Deeper >>
More Zope Articles
More By Harish Kamath, (c) Melonfire