[Zope] dtml-if syntax and comparing variables

Roché Compaan roche@up-front.co.za
Sun, 7 Nov 1999 18:00:48 +0200


Thanks Kevin, it works.

But the solution to the problem really makes me sigh deeply.  I currently
have more solutions than understanding.  The Zope Quick Reference quickly
mentions "this" as "a handy way to talk to ourselves in document templates".
I am familiar with "self" in many programming languages and "self" would
have enlightened "this" issue a bit.

I am not giving up because I just see too much potential in Zope.  I love it
but in many ways it's like a problematic child.  I don't have any strategy
in approaching the Zope Object Framework, except maybe that I'll have to
learn Python (which I'm busy with) and start digging into the code - is this
the only way?  Simple issues arise:

1.What are the rules for using quotes in dtml?
2.The nitty gritty of passing, comparing and setting variables in less than
6 hours.
3.How does one properly cross the chasm from rendering variables to
evaluating them in expressions.

Hopefull
Roché Compaan

> > #This is where I am stuck.  I simply want to compare the URL in the
> Request
> > variable to
> > #absolute_url of the folder being queried.  <dtml-if
> "URL==absolute_url">
> > does not work.
> >
> >     <dtml-if "URL==absolute_url">
>
> This is untested, but how about:
>
> <dtml-if "this() == PARENTS[0]">
>
> >       | <em><dtml-var title></em>
> >     <dtml-else>
> >       | <a href="<dtml-var absolute_url>"><dtml-var title></a>
> >     </dtml-if>
> >   </dtml-if>
> > </dtml-in>|]
> >
> > </dtml-if>
> > </dtml-with>
>
> Kevin
>