[Zope] logical operator in dtml-if

mindlace mindlace@imeme.net
Tue, 28 Mar 2000 02:08:01 +0000


Matthew Parslow wrote:
> 
> I am doing some error checking with <dtml-if>, simply to check that some
> variables exist, however I can't seem to find a syntax that ZOPE agrees with to
> use AND.
> what I want to do:
> <dtml-if Var AND anothervar AND yetanothervar>
> render page
> <dtml-else>
> you have to enter details in all the fields
> </dtml-if>
> I know this is a messy way to do it, and I'd appreciate all suggestions.
> Thanks,
> Matthew Parslow


Hmm... if you just want to check that everything is there, try
(untested):

<dtml-if "_.len(REQUEST.form) > X">
  render page
<dtml-else>
  go back and fix it
</dtml-if>

where x is the number of variables in your form.

-- 
http://mindlace.net __________________ mindlace@imeme.net
I don't want The Truth but I wouldn't mind a Big Analogy.