[ZPT] TAL's lack of an else...

Encolpe DEGOUTE edegoute at nuxeo.com
Fri Aug 1 16:18:11 EDT 2003


On Thu, 31 Jul 2003 16:45:14 +0100
Fergal Daly <fergal at esatclear.ie> wrote:

> Hi,
> 	I'm sure this must have been done to death somewhere already but I can't find 
> much on it at all. Is there a plan to add if/elsif/else type stuff to TAL? I 
> know XML is not well suited to this kind of thing, which makes it tricky, but 
> not having an else is a pretty big deficiency. I know I can do
> 
> <tag tal:condition="blah">
> 	something
> </tag>
> <tag tal:condition="not:blah">
> 	something else
> </tag>
> 
> but that involves evaluating twice and what if blah changes inside the if? 
> There's also the solution of using a temporary variable but that's very 
> cumbersome.
> 
> I guess it would have to look something like
> 
> <tag tal:condition="blah">
> 	something
> 	<tag tal:else>
> 		something else
> 	</tag>
> </tag>
> 
> or
> 
> <tag tal:condition="blah1">
> 	something
> </tag>
> <tag tal:else>
> 	something else
> </tag>
> 
> Are either of these on the cards or does someone have a really clever idea 
> brewing?

Why puts advanced programmation tools in zpt?
The test if made with a call of a python script in a define and 
several tal:condition='' make the stuff.


-- 
Encolpe DEGOUTE, Ingénieur Logiciel, Nuxeo SARL: Zope Service Provider.
Mail: edegoute at nuxeo.com - Tel: +33 (0)1 40 33 79 18
Nuxeo Collaborative Portal Server: http://www.nuxeo.com/cps
Gestion de contenu web / portail collaboratif / groupware / open source



More information about the ZPT mailing list