[Petal] 'Else' without using the ugly syntax

Jean-Michel Hiver jhiver at mkdoc.com
Fri Dec 19 11:46:56 GMT 2003


> Hi all!

Hi Michele,


> I'm fairly new to Petal (I read about it on TPJ and was very curious about
> it). I'm mostly a web coder, and I work in Italy. Until now I've been using
> HTML::Template, but I'm planning almost all future works in Petal, which
> seems superior.

That's very flattering - Thanks :)


> Anyhow, I'm writing here also because I have a question. ;-) What I
> want to do is to implement an 'else' in conditions without using the
> "ugly syntax". I solved as follows:
> 
> <span tal:condition="true:id">Modifica entry</span>
> <span tal:condition="false:id">Aggiungi entry</span>
> 
> This works, and is even nice to see. However, is there any way to
> create 'else' statements with the TAL syntax? I wasn't able to
> figure that out from the documentation.

There is no way of doing 'else' with the TAL syntax.

This topic has been discussed extensively on the ZPT mailing list back
in august:

  http://mail.zope.org/pipermail/zpt/2003-August/thread.html#4756


Cheers,
-- 
Building a better web - http://www.mkdoc.com/
---------------------------------------------
Jean-Michel Hiver
jhiver at mkdoc.com  - +44 (0)114 255 8097
Homepage: http://www.webmatrix.net/


More information about the Petal mailing list