Re: Base templates and sub templates

Roger Burton West <[email protected]> Sat, 10 Mar 2007 21:52:06 +0000
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <[email protected]>
On Sat, Mar 10, 2007 at 04:38:26PM +0100, Rudolph Froger wrote:

>I'm new on this list. I've a question on using HTML::Template for a
>larger project:
>- I will use a base template which defines the basic structure of the site.
>- Different parts of the template will have dynamic content (generated
>by the scripts).

What I did for bailii.org (and various other sites based on that code)
is a very simple approach: every page does a <tmpl_include> of the "top"
and "bottom" templates, which wrap the page-specific content. Using my
HTML::Template::Set module extension, the page template can then pass
variables to the included templates (such as the page's title).

More information if it's wanted.

Roger

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV