[Zope] dtml-if

technews@egsx.com technews@egsx.com
Sun, 5 Dec 1999 18:11:42 -0500 (EST)


Try this ... untested

<dtml-if "_.int(this_page_start) != _.int(page_start)">


On Sun, 5 Dec 1999, Kyle Burnett wrote:

> how about in this case:
> 
> <dtml-if "this_page_start != page_start">
> <P>this_page_start (<dtml-var this_page_start>) is not equal to page_start
> (<dtml-var page_start>)
> </dtml-if>
> 
> yet when both variables are in fact equal, say they both are equal to "4",
> it still tells me they are not.
> 
> 
> 
> ----------
> >From: Chris McDonough <chrism@digicool.com>
> >To: "'Adam Gotheridge'" <adam@foxvalley.net>, zope <zope@zope.org>
> >Subject: RE: [Zope] dtml-if
> >Date: Sun, Dec 5, 1999, 3:36 PM
> >
> 
> >> I can't figure out how to write this simple expression. I am trying to
> >> compare 2 variable in a dtml-if statement.
> >>
> >> ---variables:
> >> username: <dtml-var username><br>
> >> AUTHENTICATED_USER: <dtml-var AUTHENTICATED_USER><br>
> >>
> >> ---output:
> >> username: dan
> >> AUTHENTICATED_USER: dan
> >>
> >> ---expression:
> >> <dtml-if "username == AUTHENTICATED_USER">
> >>
> >>
> >> ---evaluates false and I can't figure out why! Have also tried
> >> <dtml-if "username == REQUEST['AUTHENTICATED_USER']">
> >> to no avail.
> >
> > In the if expression you're using (username==ATHENTICATED_USER), you're
> > comparing an object to a string.  AUTHENTICATED_USER is a Zope object,
> > not a string.
> >
> > You want:
> >
> > <dtml-if "username==AUTHENTICATED_USER.getUserName()">
> >
> > _______________________________________________
> > 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 )
> > 
> 
> _______________________________________________
> 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 )
>