Hi everyone, I can't find the answer to this anywhere. How do I compare the values of two <dtml-var> tags inside a <dtml-if>? Specifically, <dtml-if "<dtml-var var1> == <dtml-var var2>"> do something </dtml-if> That obviously doesn't work, but I can't figure out what would. -Tim -- Timothy Wilson | "The faster you | Check out: Henry Sibley H.S. | go, the shorter | http://slashdot.org/ W. St. Paul, MN, USA | you are." | http://linux.com/ wilson@visi.com | -Einstein | http://www.mn-linux.org/
<dtml-if "var1==var2"> do something </dtml-if> ----- Original Message ----- From: Timothy Wilson <wilson@visi.com> To: Zope listserv <zope@zope.org> Sent: Wednesday, January 05, 2000 10:52 PM Subject: [Zope] comparing <dtml-var> values Hi everyone, I can't find the answer to this anywhere. How do I compare the values of two <dtml-var> tags inside a <dtml-if>? Specifically, <dtml-if "<dtml-var var1> == <dtml-var var2>"> do something </dtml-if> That obviously doesn't work, but I can't figure out what would. -Tim -- Timothy Wilson | "The faster you | Check out: Henry Sibley H.S. | go, the shorter | http://slashdot.org/ W. St. Paul, MN, USA | you are." | http://linux.com/ wilson@visi.com | -Einstein | http://www.mn-linux.org/ _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
hi tim, you cannot use dtml tags inside other dtml tags. try replacing the example below with something like: <dtml-if "var1==var2"> do something </dtml-if> you might need some explicit typecasting to allow this operation. if var1 and var2 were strings, you should cast them explicitly as: <dtml-if "_.str(var1) == _.str(var2)"> these explicit casts can be applied to retrieve integers, floats, and other types. See the Zope Quick Reference at http://www.zope.org/Members/ZQR for references on methods available to you. jens
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Timothy Wilson Sent: Wednesday, January 05, 2000 23:53 To: Zope listserv Subject: [Zope] comparing <dtml-var> values
Hi everyone,
I can't find the answer to this anywhere. How do I compare the values of two <dtml-var> tags inside a <dtml-if>? Specifically,
<dtml-if "<dtml-var var1> == <dtml-var var2>"> do something </dtml-if>
That obviously doesn't work, but I can't figure out what would.
-Tim
participants (3)
-
Jens Vagelpohl -
Jim Sanford -
Timothy Wilson