-----Original Message----- From: Dieter Maurer [mailto:dieter@handshake.de] Sent: Tuesday, June 27, 2000 3:31 AM To: djay@lucent.com Cc: 'zope@zope.org' Subject: RE: [Zope] (no subject)
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.
You could but this is something I end up doing a lot esp with the way hyperlinks work. Syntax to help would make it cleaner. It is not to much of a pollution of the name space as 'always' and 'then' would only be active inside an if statement.