Glasnost

help

 

Template Attribute Language

The Template Attribute Language (TAL) is an attribute language used to create dynamic templates. It allows elements of a document to be replaced, repeated, or omitted.

The statements of TAL are XML/HTML attributes from the TAL namespace.

Example

A webdesigner's template like

<div class="article">
  <h1>Article Title</h1>
  <div class="author">Author's name</div>
  ...

can be modified by a developer to fetch appropriate content

<div class="article">
  <h1 tal:content="currentObject.label">Article Title</h1>
  <div class="author"
       tal:content="currentObject.authorsSet[0].label">
   Author's name</div>
  ...

and remains understandable by the webdesigner, and editable in graphical HTML editors.

up