[ZPT] metal macros expansion extremes

Evan Simpson evan@digicool.com
Mon, 21 May 2001 12:28:36 -0400


From: "Peter Bengtsson" <mail@peterbe.com>
> Currently, the so called templates aren't real full blooded templates.
They
> don't have a <dtml-var standard_html_header> or ...footer>
> Some of them are just a little table or a piece of text.
> When we start using ZPT instead I would like to be able to have the
<html>,
> <body>, <head> tags in there so that we can open them easily in Golive.

This is exactly what METAL macros are meant for.  You create a master
template in which you embed page fragments that you want to share.  This
template acts as a macro library.  Each fragment has a metal:define-macro on
it, and you reuse them by placing the following sort of declaration in other
Page Templates:

<div metal:use-macro="here/myLibrary/macros/mname1"></div>
<div metal:use-macro="here/myLibrary/macros/mname2"></div>

Cheers,

Evan @ digicool