Template Attribute Language Expression Syntax
The Template Attribute Language Expression Syntax ( TALES ) describes the syntax for the evaluation of the Template Attribute Language (TAL ) and Macro Expansion Template Attribute Language (METAL) used for attribute values expressions. The possibility for this to use a different syntax than TALES is expressly provided; usually TALES is not replaced, but extends it.
The web application server Zope TALES extends the specification in the context of Zope Page Templates.
- 2.1 Simple Path Expression to access a macro
- 2.2 loop path, python and string expressions
- 2.3 Logical negation and TAL elements
Overview
TALES provides several methods available to formulate expressions that can be used in TAL and METAL attributes and are distinguished by an (optional ) prefix:
Types of expressions
Built- name
These names are usually supplemented by another, see Zope Page Templates.
Examples
Simple Path Expression to access a macro
Loop path, python and string expressions
- The tal: repeat attribute creates a variable item and, with the help of the Python expression, a sequence of Dictionary, which is used to generate multiple HTML table rows
- The special loop variables (eg number) for item will repeat on the services requested by TALES standard variable provided
- Path expressions can also be used within string expressions
Logical negation and TAL elements