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

George M. Ellenburg george@ellenburg.org
Wed, 8 May 2002 08:27:00 -0400


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 08 May 2002 08:19 am, Gilles Durys wrote:
>
> 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

On Wednesday 08 May 2002 09:19 am, hans wrote:
>
> it took me some time to understand, but basically there are 2
> different ways for name resolution. name=... is DTML searching,
> expr="..." is python searching (everything in " " is python).
> a name-attribute may consist only of one identifier (thats why syntax
> error!) (in <dtml-if name=myid>, nonexistence is treated as falsehood).

On Wednesday 08 May 2002 08:22 am, Geir Bækholt wrote:
>
> <dtml-if "tip == 1">
> .. or even clearer :
> <dtml-if expr="tip == 1">
>
> eveluations like this have to be done as python expressions , hence
> the quotes (they are really just a shorthand for expr="" , and have
> served to confuse many a newbie....)


Okay,

So if I understand this correctly, even though the expr is called, and it's 
evaluating outside the scope of the website, will Python then eventually 
evaluate it *in* the scope of the website (through acquisition or inheritence 
or whatever?)

Sorry, I'm *so* not an OO programmer. ;-)

Wouldn't (or couldn't) there be a name-collision if I'm passing a variable/ 
constant that's already defined (or reserved)?

Thanks again for all your help!

- -- 
George M. Ellenburg <george@ellenburg.org>
<http://www.ellenburg.org/>
3 Years and counting of being 100% Microsoft-free; and much more productive.
Proud user of ASK <http://www.paganini.net/ask/>, the Active Spam Killer!
- ---
"The bland leadeth the bland and they both shall fall into the kitsch."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE82RmUFItzMEWZZdgRAqoIAJ9aWbe5FeE9HygnL0fFu2YoO4BMIwCfXTvQ
EhV1TTZN4vW9b/8TdYkR3K0=
=onz7
-----END PGP SIGNATURE-----