[Zope] newbie question about DTML IF

Tom Cameron tom@cameron.to
Wed, 24 Oct 2001 21:27:58 +1000


I am not sure about he expression, but normally you should use '==' for an
equals comparison

<dtml-if "A==B">.....

Tom

=> -----Original Message-----
=> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Myles
=> Byrne
=> Sent: Wednesday, 24 October 2001 9:17 PM
=> To: zope@zope.org
=> Subject: [Zope] newbie question about DTML IF
=>
=>
=> I'm trying to add a statement to my page that greets each user with a
=> different statement, but i can't seem to work out how to do it.
=>
=> Just from reading some of the zope documentation i've tried:
=>
=> <dtml-if expr="AUTHENTICATED_USER = bob">
=> bob likes to eat fish
=> </dtml-if>
=>
=> and
=>
=> <dtml-if expr="str(GetUser()) = bob">
=> bob likes to eat fish
=> </dtml-if>
=>
=> Both of these are obviously very wrong, in the first case i thought it
=> might have something to do with calling an object and trying to compare
=> it to a string so in the second one i tried rendering it into a string,
=> but evedently this isn't the correct way to do that. I'm new to both
=> zope and python and I have a feeling I have the whole thing totally
=> wrong.
=>
=> Would it be better to do this in python some how and store each users
=> greeting in a dtml document?
=>
=> any suggestions would be greatly appreciated
=>
=> Thanks
=>
=> Myles
=>
=>
=> _______________________________________________
=> 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 )
=>