[ZPT] Varying templates based on location

Chris Withers chrisw@nipltd.com
Sat, 17 Aug 2002 18:06:11 +0100


Jean Jordaan wrote:
> 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.

Hmmm, fwiw, slots shouldn't be filled by 'pages'.

I think the idea with ZPT is to use them as templates you apply to content. So, 
you would have a 'page' template that was applied to all 'page' objects.

...but I see your point.

> /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>)

...this is the ickyness. Does this happen a lot, or only with the 'intro' slot?

>     index_html (use-macro="here/template/macros/page";
>                 fill-slot="intro")

I guess sorting these things out is just a question of fiddling until you get a 
graceful solution :-S

cheers,

Chris