it works:

<dtml-if "var1=='OK' and var2==3 and var3 in ('a',1,'1') and var4 != 'OK' and var5">


note1: var5 is string, true when <>'' nor None but must exists

note2: var5 is int, true when <>0 nor None but must exists

<dtml-else>
</dtml-if>


----- Puvodní zpráva ----- Od: Justin Dunsworth

Is there any way to check if multiple variables exist in the same if statement? Right now I am having to writing multiple nested if statements but can be quite cumbersome... so just looking for an easier way.


Currently I'd have to write:
<dtml-if var1>
 <dtml-if var2>
   <dtml-if var3>
   <dtml-else>
   </dtml-if>
 <dtml-else>
 </dtml-if>
<dtml-else>
</dtml-if>


When it would be easier to do something like:


<dtml-if "var1 and var2 and var3">
<dtml-else>
</dtml-if>


_______________________________________________
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to