[Zope] TAL tutorial

Sascha Welter zopelist at betabug.ch
Wed Mar 8 03:11:41 EST 2006


(Tue, Mar 07, 2006 at 12:00:05PM -0500) zope-request at zope.org wrote/schrieb/egrapse:
> From: John Poltorak <jp at warpix.org>
> Subject: [Zope] TAL tutorial
> 
> Can anyone point me to a good TAL tutorial for people who have difficulty 
> getting to grips with it?

Assuming you have read and practiced the 2 chapters on ZPT in the Zope
book I would also recommend peterbe's "DTML2ZPT Conversion examples",
even if you have never done DTML, these are a collection of common code
snippets:
http://www.zope.org/Members/peterbe/DTML2ZPT

After that keep in mind that anything complicated enough to need 
"python:" in a TAL statement should likely be moved out to a python
method. (That could be either a python script through the ZMI, or even
better a method of your filesystem based python product.) The results of
the python method can then be placed in the option space and accessed
very easily from the ZPT. A common usage scheme is to always call the
python method through the web, which assembles all needed data and then
returns the ZPT with the data as parameters.

Have fun!

Regards,

Sascha



More information about the Zope mailing list