>>>>> "Dennis" == Dennis Daupert <[EMAIL PROTECTED]> writes:

Dennis> I have two related questions. I'm writing a site that will
Dennis> offer the capability of registering for online
Dennis> stores/shops. Each shop will be configurable, in that the
Dennis> registrant will choose from a selection of functions, such as
Dennis> eCards, photo gallery, etc. I'd also like to offer a set of
Dennis> skins from which each shop keeper can choose a look and feel
Dennis> for his/her shop. My question: I have a site wrapper for my
Dennis> overall web; is there a way to override my site wrapper within
Dennis> each shop? To put this another way, my site will have "master"
Dennis> functions (eCards, gallery, so forth) which each shop will use
Dennis> instances of, but the shops will each need their own look.

Well, the brute force way is like this:

    [% master = { this_wrapper => 'master_wrapper.tt' } %]
    [%# site = { this_wrapper => 'site_wrapper.tt' %] %]
    [% this_wrapper = site.this_wrapper || master.this_wrapper %]
    [% WRAPPER $this_wrapper %]
    some wrapped stuff
    [% END %]

Or you can simply have your master wrapper be "pluggable"... let them
define their own sub-elements in a search path, so that when you
WRAPPER or INCLUDE, it first looks in the individual template
directory before searching to the master template directory.

Dennis>  My related question is, I want to run a wiki that will have
Dennis>  the capability of selecting a template from an option list to
Dennis>  apply to each page. The overall site wrapper would apply
Dennis>  unless an individual page template is selected. Is overriding
Dennis>  the master site wrapper for each page a good way to think of
Dennis>  this, or is there another, better, approach?

It's a matter of programming.  Depends on what you're optimizing for.
You can do it procedureally (like above), objectively (nested VIEWs),
via search paths, or however you want to do it.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to