[Zope] (no subject)

Dieter Maurer dieter@handshake.de
Mon, 26 Jun 2000 19:30:42 +0200 (CEST)


Jay, Dylan writes:
 > ...
 > Perhaps another example will prove its uglyness.
 > 
 >  <dtml-if "REQUEST.has_key('some_value') and this().has_key(some_value) and
 > _[some_value] == 'a property value' and
 > AUTHENTICATED_USER.has_role('Manager')">
 >   <a href="a_url">
 >  </dtml-if>
 >   link text
 >  <dtml-if "REQUEST.has_key('some_value') and this().has_key(some_value) and
 > _[some_value] == 'a property value' and
 > AUTHENTICATED_USER.has_role('Manager')">
 >    </a>
 >  <dtml-else>
 >    (no link available)
 >  </dtml-if>
 > 
 > 
 > or
 > 
 > <dtml-if "REQUEST.has_key('some_value') and this().has_key(some_value) and
 > _[some_value] == 'a property value' and
 > AUTHENTICATED_USER.has_role('Manager')">
 >   <a href="a_url">
 > <dtml-always>
 >   link text
 > <dtml-else>
 >   (no link currently available)
 > <dtml-then>
 >   </a>
 > </dtml-if>
 > 
 > Now which looks cleaner?
You could use "dtml-let" to avoid the (admittedly) ugly
repetition of the condition.


Dieter