Forum OpenACS Development: Response to Use of master templates

Collapse
Posted by Robert Locke on
Hmmm... maybe this suggestion is arriving a little bit too late, but I think there might be some value to having "package-wide" master templates, and I suspect that Arsdigita structured most of their modules that way for a reason.

However, I would recommend maybe having an extremely stripped-down, bare minimum master template as shown in this example (ie, no <hr>, @context_bar@, etc):

    foo_package/www/some_page.adp:
        <master src=master>
        ...
        ...
    foo_package/www/master.adp would simply contain:
        <master>

In a recent site, I added a property called "show_collage", which would determine whether or not to show a collage in certain sections of the site (a client requirement). For some packages, I enabled the "collage", and in others, I disabled it (technically, it simply defaulted to 0 when undefined). It was nice to be able to simply edit a single package-wide "master" template to add that property where needed.

I suppose another approach would've been to check the "package_key" in my site-wide master template, but the above seemed "cleaner". There might be other uses as well for package-wide master templates.