[ZPT] Varying templates based on location
Jean Jordaan
jean@upfrontsystems.co.za
Fri, 16 Aug 2002 16:56:17 +0200
Jean Jordaan wrote:
> This seems to work:
>
> <metal:page define-macro="page">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
> lang="en"
> metal:use-macro="here/bis_root/macros/page">
> ...
> </html>
> </metal:page>
Ooer, now I have to do this in 'template':
<div metal:fill-slot="intro">
<div id="intro" metal:define-slot="intro">
</div>
</div>
in order to cascade slots .. Either reusing template code is a lot
more involved than DTML, or there's zen that I'm just not getting :/
To recap: I want a global template in the root, with overridable
navigation and intro (etc). In subfolders I want customized templates,
in which I override certain slots. Other slots I want to leave (at
their defaults, preferably), for filling by pages that use the custom
template.
/site_root/
template (define-macro="page";
define-slot="navigation" <default navigation>;
define-slot="intro" <default intro>)
/site_root/site1/
template (define-macro="page";
use-macro="here/site_root/template/macros/page";
fill-slot="navigation" <overrides default navigation>;
fill-slot="intro";
define-slot="intro" <nukes default intro>)
index_html (use-macro="here/template/macros/page";
fill-slot="intro")
--
Jean Jordaan
Upfront Systems http://www.upfrontsystems.co.za