[Zope] Else branch for Page Template conditions

Jens Vagelpohl jens@zope.com
Fri, 27 Sep 2002 07:50:51 -0400


<span tal:content="options/name | default"> Name does not exist </span>

will do what you want.

jens


On Friday, Sep 27, 2002, at 03:26 US/Eastern, Andreas Tille wrote:

> Hi,
>
> while looking for examples using
>
>        tal:condition
>
> I just find solutions for an else branch.  For instance I want to
> do something like that
>
>        <span tal:condition="options/name | nothing"
>          tal:content="options/name">Print here variable name.</span>
>
> If variable "name" exists print it but I'm seeking for something like
>
>        else print "name does not exist"
>
> Even better would be a method to set variable name to a default value
> if it does not exist before the test above and print the stuff
> unconditionally.
>
> Kind regards
>
>         Andreas.
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )