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

Fergal Daly fergal at esatclear.ie
Thu Jul 31 17:45:14 EDT 2003


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?

F




More information about the ZPT mailing list