[Zope] dtml-if syntax and comparing variables

Roché Compaan roche@up-front.co.za
Mon, 8 Nov 1999 09:53:54 +0200


> When I answer questions on the list, I tend to answer with a specific
> solution. In some instances, this is just what the person
> wants... at other
> times, the person is really looking for more general guidance
> about finding
> that kind of solution. It's hard to tell sometimes which way to answer :)

Thanks for wonderful guidance.  I had no problem with your answer.  My
frustration was with dtml in particular.  What particularly confused me in
my initial effort was that i could render the values of two variables with
the same values but when i compared these variables in an expression nothing
happend eg:
  <dtml-with objectValues>
     <dtml-var URL>   // renders a URL  mysite/folder
     <dtml-var absolute_url>  //render absolute_url  mysite/folder
     <dtml-if "URL==absolute_url">   // even if the values where the same it
always did the else part
        do something
     <dtml-else>
        do something else
     </dtml-if>
  </dtml-with>

> Comparing variables is pretty easy:

Comparing variables inside dtml-with statements seem to be more tricky
though.  Am I correct in saying that when i use a dtml-with statements it
pushes the object i'm working with to the top of the namespace?

Many thanks
Roché Compaan