[ZPT] Passing objects

Colin Fox cfox@crystalcherry.com
06 May 2002 09:48:11 -0700


--=-FStYEenBjRoKeQFO1ddY
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Mon, 2002-05-06 at 08:27, Evan Simpson wrote:
> Colin Fox wrote:
> > I had a large, complicated ZPT that I'm trying to split up. It has
> > logical sections, so I'm just taking each section out and making it a
> > zpt and including it with <span tal:replace=3D"structure
> > here/subtempl"></span>
>=20
> This is exactly what METAL is for.  Most discussion of it centers on the=20
> more difficult slot-oriented page macros, but breaking out bits is quite=20
> easy. Instead of the tal:replace, you would write:
>=20
> <div metal:use-macro=3D"here/subtempl/macros/main"></div>
>=20
> ...and wrap the sub-template in a <div metal:define-macro=3D"main">.  Now=
=20
> the subtemplate will be treated as part of the main template during=20
> rendering, and all variables will be shared.

Thanks - that worked perfectly! I didn't realize that there was this
kind of difference between sub-templates and metal macros.

--=20
Colin Fox                                       cfox@crystalcherry.com
CF Consulting Inc.                                    GPG Fingerprint:
                    D8F0 84E7 E7CC 5C6C 9982  F1A7 A3EB 6EA3 BC97 572F

--=-FStYEenBjRoKeQFO1ddY
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA81rPLo+tuo7yXVy8RAk1CAJ4jOygKOORng2sAt5MHvGUITuq06gCcDzwA
zgAXXyMKcFIVrCGRXBA2rzc=
=Kzic
-----END PGP SIGNATURE-----

--=-FStYEenBjRoKeQFO1ddY--