home contents changes options help subscribe

Zope's Page Templates are a successor to DTMLDocument/DTMLMethod which provide a more explicit and HTML-editor-safe way of dynamically generating HTML or XML. If you want to customize the appearance of Plone, CPS, ZWiki or pretty much any ZopeProduct, you should learn Page Templates. The technology is also used in some non-Zope applications.

"The goal of Page Templates is to allow designers and programmers to work together easily. A designer can use a WYSIWYG HTML editor to create a template, then a programmer can edit it to make it part of an application. If required, the designer can load the template back into his editor and make further changes to its structure and appearance. By taking reasonable steps to preserve the changes made by the programmer, the designer will not disrupt the application."

Page templates use an attribute language called TAL (Template Attribute Language) which lives inside standard XHTML (or any XML) tags. Example:

  <span tal:content="request/name"> name appears here </span>

Another language called METAL is used to define macros, where one template can call parts of another. Be warned, things get slightly mind-bending at this point. But it all fits together like a swiss clock!

Page Templates are slightly slower than DTMLMethods. They are harder to understand at first (macros) but easier to understand in the long term (less "magic" than DTML). They are also much better for i18n. Many Zope folk prefer to use them exclusively.

See:

Page Templates Vs DTML