>>>>> "Ask" == Ask Bjoern Hansen <[EMAIL PROTECTED]> writes:

Ask> What I would like to do:

Ask>   A) Not have to call header and footer in each "real" file.
Ask>      o) Still be able to "skip" the header and footer, I can
Ask>         hack that with CLEAR and STOP.  Are there any nicer
Ask>         ways to do it?

What I do on stonehenge.com is essentially:

page.html:

        [% META style = mainpage %]
        content goes here

other.html:

        content goes here

PROCESS = wrapper.tt in my configuration

wrapper.tt:

        [% style = template.style %]
        [% DEFAULT style = default %]

        [% WRAPPER style/${style} %]
        [% PROCESS $template %]
        [% END %]

then in style/mainpage:

        [% PROCESS header.html %]
        [% content %]             <<<--- page.html is inserted here
        [% PROCESS footer.html %]

With style/default used for anything that doesn't declare a specific
style.

To change the "style", you just change the meta info.

I have some error trapping as well, and I'm using views to give
a hierarchy in an object-oriented way, but the above is essentially
what I'm doing.

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