Template Attribute Language


Table of Contents

1. Attribute priority
2. TAL namespace
2.1. tal:define
2.2. tal:condition
2.3. tal:repeat
2.4. tal:omit-tag
2.5. tal:replace
2.6. tal:content
2.7. tal:attributes
2.8. tal:on-error
3. METAL namespace
3.1. metal:define-macro
3.2. metal:use-macro
3.3. metal:define-slot
3.4. metal:fill-slot
4. I18N namespace
4.1. i18n:translate
4.2. i18n:name
5. PHPTAL namespace
5.1. phptal:debug
5.2. phptal:cache
5.3. phptal:tales
6. *:block
7. PHPTALES
7.1. path:
7.2. Conditional statements
7.3. string:
7.4. php:
7.5. not:
7.6. exists:
7.7. default
7.8. structure
7.9. Expression chains

This section describes TAL and its extensions. It mainly targets template designers but must be read by PHP integrators as well.

1. Attribute priority

It is important to note that the order of declaration of attributes is irrelevant.

For example,

<span tal:define="usersList application/listUsers" 
      tal:condition="somecondition"
      tal:repeat="user usersList"
>...</span>

Is EXACTLY the same as:

<span tal:repeat="user usersList"
      tal:condition="somecondition"
      tal:define="usersList application/listUsers" 
>...</span>

Priority is the same as described by TAL specifications:

  1. define

  2. condition

  3. repeat

  4. content or replace

  5. attributes

  6. omit-tag