[ZPT] REQUEST argument

Lalo Martins lalo@hackandroll.org
Mon, 14 May 2001 04:12:55 -0300


On Sun, May 13, 2001 at 07:10:15PM -0500, Guido van Rossum wrote:
> 
>   <dtml-if foo>
>     <dtml-var foo>
>   </dtml-if>
> 
> which substitutes foo only if it exists and is non-empty, and Jim
> claims that this is useful.
> 
> How would one write DTML that substitutes foo if it exists, regardless
> of whether it is empty?

There are also the 'null' and 'missing' attributes of dtml-var:

<dtml-var spoon missing="">

This omits the tag (tal:replace="nothing") if there is no spoon.

<dtml-var spoon missing="there is no spoon">

This substitutes "there is no spoon" if there is no spoon.

<dtml-var spoon null="there is no spoon">

This substitutes "there is no spoon" if the spoon is empty, but
raises an exception if there is actually no spoon.

[]s,
                                               |alo
                                               +----
--
           I say a prayer now our love's departed
                That you'll come back to stay
                  Bring back the perfect day

http://www.laranja.org/                mailto:lalo@laranja.org
         pgp key: http://www.laranja.org/pessoal/pgp

Brazil of Darkness (RPG)      ---       http://www.BroDar.org/