The Template Attribute Language Expression Syntax (TALES) standard describes expressions that supply TAL and METAL with data. TALES is one possible expression syntax for these languages, but they are not bound to this definition. Similarly, TALES could be used in a context having nothing to do with TAL or METAL.
TALES expressions are described below with any delimiter or quote markup from higher language layers removed. Here is the basic definition of TALES syntax:
Expression ::= [type_prefix ':'] String type_prefix ::= Name
Here are some simple examples:
a/b/c path:a/b/c nothing path:nothing python: 1 + 2 string:Hello, ${user/getUserName}
The optional type prefix determines the semantics and syntax of the expression string that follows it. A given implementation of TALES can define any number of expression types, with whatever syntax you like. It also determines which expression type is indicated by omitting the prefix.
If you do not specify a prefix, Zope assumes that the expression is a path expression.
These are the TALES expression types supported by Zope:
These are the names that always available to TALES expressions in Zope:
repeat
variables; see the
tal:repeat documentation. Note the names root
, here
, container
, template
, request
,
user
, and modules
are optional names supported by Zope, but
are not required by the TALES standard.
exists expressions
nocall expressions
not expressions
string expressions
path expressions
python expressions