Glasnost

help

 

TAL Statements: define

tal:define="variable expression"

tal:define="global variable expression"

Variables can be defined with the define statement. Variables may be:

Examples

<div tal:define="title currentObject.label">
  <h1 tal:content="title">Title</h1>
</div>
<div tal:define="global title currentObject.label"
     tal:omit-tag=""></div>
<h1 tal:content="title">Title</h1>

[1] Global variables can be used in any element processed after the element where they are defined. Redefining a global variable replaces its definition for the rest of the template.

up