In this second article, dive a little deeper into theintricacies of DTML by getting up close and personal with conditionalstatements and comparison operators. This article discusses thedifferent variants of the "if" statement available in DTML, togetherwith examples and code listings that demonstrate how they can be used ina Web applications.
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>