METAL

METAL

The Macro Expansion Template Attribute Language complements TAL, providing macros which allow the reuse of code across template files. Both were created for Zope but are used in other Python projects as well.

Overview

METAL complements TAL with the ability to reuse code. It allows the developer to define and use macros, which in turn may have "slots"; when using a macro, variational content can be specified for a slot.

When Generating XML documents, the XML namespace must be specified(xmlns:metal="http://xml.zope.org/namespaces/metal").

Attributes

The following attributes are recognised, normally requiring a „metal:“ prefix:

; define-macro: creates a macro; define-slot: creates a slot inside a macro; use-macro: uses a macro (normally given via a TALES path expression); fill-slot: when using a macro, replaces the default content of the given slot; extend-macro: since Zope v3: extends a macro, comparable to subclassing, by redefining of slots

Normally, just one of those is used at a time.

In cases when no tag is present which lends itself to take the attributes, and in special cases when more than one METAL attribute is needed, special METAL tags can be used, making the „metal:“ prefix optional. E. g. (sketched with Roundup in mind): <html metal:define-macro="icing"> ... <metal:myslot define-slot="optional-form"/> ... </html> <html metal:use-macro="templates/page/macros/icing"> <form metal:fill-slot="optional-form" action="." tal:attributes="action context/designator"> ... </form> </html>

Usage

TAL/TALES/METAL are used by the following projects:

* Zope (web-based application server)
* Roundup (issue tracker)

External links

* [http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixC.stx#2-69 METAL Overview (Zope Book)]


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Metal — Entstehungsphase: Anfang 1970er Jahre Herkunftsort: Großbritannien Stilistische Vorläufer Hard Rock Pionierbands …   Deutsch Wikipedia

  • métal — métal, aux [ metal, o ] n. m. • déb. XIIe; lat. metallum « métal, mine » 1 ♦ Corps simple, doué d un éclat particulier (éclat métallique), bon conducteur de la chaleur et de l électricité et formant, par combinaison avec l oxygène, des oxydes… …   Encyclopédie Universelle

  • Metal — Met al (? or ?; 277), n. [F. m[ e]tal, L. metallum metal, mine, Gr. ? mine; cf. Gr. ? to search after. Cf. {Mettle}, {Medal}.] 1. (Chem.) An elementary substance, as sodium, calcium, or copper, whose oxide or hydroxide has basic rather than acid… …   The Collaborative International Dictionary of English

  • metal — (Del fr. métal, o cat. metall). 1. m. Quím. Cada uno de los elementos químicos buenos conductores del calor y de la electricidad, con un brillo característico, y sólidos a temperatura ordinaria, salvo el mercurio. En sus sales en disolución… …   Diccionario de la lengua española

  • metal — sustantivo masculino 1. Cuerpo simple que se caracteriza por tener un brillo particular, ser un buen conductor del calor y la electricidad y ser sólido a temperatura ambiente (excepto el mercurio): metales alcalinos, metales de tierras raras,… …   Diccionario Salamanca de la Lengua Española

  • metal — s. m. 1. Nome genérico dos corpos minerais, mais ou menos maleáveis e fusíveis, que são bons condutores da eletricidade e do calórico. 2.  [Figurado] Dinheiro; riquezas. 3. Tom, timbre. 4.  [Heráldica] Cor branca (de prata) ou amarela (de ouro).… …   Dicionário da Língua Portuguesa

  • metal — [met′ l] n. [OFr < L metallum, metal, mine, quarry < Gr metallon, mine, quarry] 1. a) any of a class of chemical elements, as iron, gold, or aluminum, generally characterized by ductility, malleability, luster, and conductivity of heat and… …   English World dictionary

  • Metal — Met al, v. t. [imp. & p. p. {Metaled} (? or ?) or {Metalled}; p. pr. & vb. n. {Metaling} or {Metalling}.] To cover with metal; as, to metal a ship s bottom; to metal a road. [1913 Webster] …   The Collaborative International Dictionary of English

  • metal — Metal, Metallum. Metal d argent, Argentum. Metal fait d or, avec la cinquieme partie d argent, Electrum. Une sorte de metal qui se trouve és mines d or et d argent, Sandaracha. Qui tire les metaux de la terre, Metallicus …   Thresor de la langue françoyse

  • metal — I {{/stl 13}}{{stl 8}}rz. mnż III, D. u; lm D. i {{/stl 8}}{{stl 7}} substancja o charakterystycznym połysku, dużej ciągliwości i kowalności, będąca dobrym przewodnikiem ciepła i elektryczności, np. miedź, żelazo, ołów, złoto <łac. z gr.>… …   Langenscheidt Polski wyjaśnień

  • metal — METAL. s. m. Corps mineral qui se forme dans les entrailles de la terre, & qui est fusile & malleable. L or est le premier, le plus beau, & le plus precieux des metaux. il y a sept metaux qu on attribuë aux sept Planetes. le vif argent est un… …   Dictionnaire de l'Académie française

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”