[Zope] Testing document properties

Rafael Cordones Marcos rcm@bcnartdirecte.com
Wed, 20 Oct 1999 12:24:55 +0200


Hi,

I have several DTML Doc named "caso" each of them in a diferent
directory.
Two of these "caso" documents have a property called "idioma" with
type string and value "en". The others do not have this property.

In the parent directory I have another document in which I want to
check this property *when* available. So I do:

<dtml-if caso.idioma>
  <dtml-if "caso.idioma == 'en'">
    <h2>What is your diagnosis?</h2>
  <dtml-else>
    <h2>¿Cual es su diagnóstico?</h2>
  </dtml-if>
<dtml-else>
  <h2>¿Cual es su diagnóstico?</h2>  <****
</dtml-if>

I want to test if this property exists. If it exists and its value is
"en" then print a text in English. Otherwise print it in Spanish.
The above DTML code always returns the text marked with "<****".
I've tried puttin the first if in double quotes like <dtml-if
"caso.idioma"> but it fails when the document does not have this
property.

Thanx for any help.

Regards,

Rafa
 
-- 
Linux. The Choice of a GNU Generation! -> http://www.debian.org