I have a lot of REQUEST like this one to check, depending on what
documents are in the folder.

<dtml-unless SOMEREQ>
<dtml-call "REQUEST.set('SOMEREQ','defaultvalue')">

RH: this should work. It works with me

so i gave all documents concerned 2 properties

(in our example
myPropName : SOMEREQ
myPropValue : defaultvalue)

So i'm able to iterate the documents and check the properties and
set the REQUEST.

<dtml-in "objectValues(['DTML Document'])">
<dtml-if "_.hasattr(this(), 'myPropName') == 1">
  <dtml-call "REQUEST.set(myPropName,myPropValue)">

this works OK.

But, I can't find a way to generate the
<dtml-unless SOMEREQ> tag.

Passing the value of myPropName seems to fail (erreur while
parsing the syntax, or check the 'myPropName' instead of his
I tried a lot of things and syntax around <dtml-unless
myPropName>, but it failed.

RH: Um, as you describe it, you mix up the name of the  property and its
value (but that might be a matter of desciption). Try something like the
<dtml-unless "myPropName==SOMEREQ">
    <dtml-call "REQUEST.set('myPropName', defaultvalue)">

note that 1) this will only work if there is a myPropName and a defaultvalue
variable in the namespace and 2) this won't change the value of the property



Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to