home contents changes options help subscribe edit (external edit)

Macro Expansion for TAL (or METAL)

Macros provide a way to define a chunk of presentation in one template, and share it in others, so that changes to the macro are immediately reflected in all of the places that share it.

Macros are a special set of TAL statements that are processed separately from other statements. There are statements to define macros and macro slots, and to use macros and provide macro arguments. When a template which uses METAL macros is rendered, it expands them before processing other TAL statements.

PageTemplates implement METAL, and expand all of the macros used in a template when generating its source, as well as when rendering it. This allows macros to be viewed in-place.

See the METAL specifications for details of what METAL provides:

See DiscussMETAL for discussion of proposals for future specifications.


emiliano (Mar 13, 2001 4:27 am; Comment #3)
If the macros are unfolded in full it is essential that it be very clear to the user which parts are editable, especially if you're editing a macro that includes static parts (non-slots) or that calls other macros itself. Assuming that there's some kind of access control scheme in place, this can get quite tricky.


comments:

Link Broken: Metal Specification 1.0 --hospital_pass, Thu, 06 Sep 2007 13:33:41 +0000 reply
The link to Metal Specification 1.0 does not function. Page missing?

Link Broken: Metal Specification 1.0 --simon, Thu, 06 Sep 2007 20:15:29 +0000 reply
Thanks for the report, I have fixed the old page.



subject:
  ( 6 subscribers )