[Zope] Quick question about <dtml-if ...>

Gilles Durys gdurys@icogs.com
Wed, 08 May 2002 14:19:37 +0200


On 05/08/2002 02:00 PM, George M. Ellenburg wrote:
> I have a quick question regarding <dtml-if ...>  (I'm up to Chapter 4 in the 
> Zope Book right now.)
> 
> If I have a URI like this:
>    GET /foo?a=3
> 
> And the corresponding DTML contains:
> 
> <dtml-if expr="a=3">
>   <!-- Some Junk -->
> </dtml-if>
> 
> ....Wouldn't this evaluate the Python expression?
> 
> I've tried doing:
> <dtml-if a=3>
>   <!-- -->
> </dtml-if>

You should use this:
<dtml-if expr="a=='3'">
   <!-- blablabla -->
</dtml-if>

a=='3' test is a equals '3' (I think form values are always strings - 
not sure though)
a=3 assigns the value 3 to a

-- 
Gilles Durys