[PHPTAL] Re: Layered METAL Templates
James Davies
phptal at foomatic.net
Tue Feb 27 05:48:30 CET 2007
Hi. (Apologies if I sent this twice, had a problem with my mail client).
Coming from Zope, I often "Layer" my page template (That is, have a sub
template for a section of the site that subclasses off main_template and
adds extra headings).
This involves having a template that Fills the slot in a macro, then
redefines the slot for sub pages to fill.
The following method works in Zope and older versions of PHPTal, however it
doesn't seem to be working in 1.1.8
Does anyone have any idea whats causing this, and how I could fix it? (I'm
happy to tweak the phptal code myself if someone can point me in the right
direction).
Thanks,
James.
-------------------
* main_template.pt
<html metal:define-macro="master">
<body>
<h1>Page Header</h1>
<metal:block define-slot="main"/>
</body>
</html>
* sub_template.pt
<metal:block define-macro="master">
<html metal:use-macro="main_template.pt/master">
<body metal:fill-slot="main">
<h2>Sub Header</h2>
</body>
</html>
</metal:block>
* content.pt
<html metal:use-macro="sub_template.pt/master">
<body metal:fill-slot="main">
<p>Sub Page Content</p>
</body>
</html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/phptal/attachments/20070227/147a0cea/attachment.htm
More information about the PHPTAL
mailing list