[ZPT] If/else?

Evan Simpson evan@digicool.com
Wed, 9 May 2001 15:15:20 -0400


From: "Brent M Hendricks" <brent@valinor.waldenweb.com>
> <div tal:condition="python:doChange()" tal:replace="....">
>  .. some default stuff...
> </div>
>
> Any advice?  This seems to me like a pretty common use-case scenario.

Guido, Jim, and I just had a meeting in which we discussed this sort of
thing.  I'm about to put the proposed changes that we came up with into the
Wiki. With these changes you would write:

<div tal:replace="python:if(doChange(), ..., default)">

...where 'default' is a new builtin variable that causes the default value
to be left in place when it is returned.

Cheers,

Evan @ digicool