Macro Expansion Template Attribute Language
The Macro Expansion Template Attribute Language ( METAL , English for macro language for attribute-based template processing ) allows the definition of macros for the reuse of code in other templates. It is usually used in conjunction with the Template Attribute Language , but is not limited to it; look there.
METAL was created as part of the Zope web application server ; see also Zope Page Templates .
overview
METAL complements Template Attribute Language (TAL) with the ability to reuse code. For this purpose macros can be defined, which in turn can have so-called slots; When using a macro, the content of the slots can be overwritten in addition to the evaluation of TAL variables.
If XML documents are to be generated, it is important to enter the XML namespace ( xmlns:tal="http://xml.zope.org/namespaces/metal"
).
Attributes
The following attributes are recognized, which normally metal:
have to be preceded by the prefix " ":
- define-macro
- creates a macro
- define-slot
- creates a slot within a macro
- use-macro
- uses a macro (usually specified by a TALES path expression)
- fill-slot
- replaces the specified slot when using a macro
- extend-macro
- since METAL 1.1 ( Zope 3): extends a macro, comparable to an object hierarchy , by redefining existing slots
use
TAL / TALES / METAL are used by the following projects: