|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: Abstracting away layout details when using large HTML::Template-based sites?by ww (Chancellor) |
| on Dec 08, 2007 at 16:06 UTC ( #655840=note: print w/ replies, xml ) | Need Help?? |
|
I may be missing something here, but this seems to work, at the price of (partially) re-mixing content and layout. Further, from the description of your project, I'm guessing that you will be taking the title from the command line or yet another file, hence the new var, $input.
When layout.tmpl is modified by moving the line <h2>...</h2> from page.inc, to line 6 here:
after which, page.inc becomes simply <p>Imagine content here ..</p>and the output is:
This leaves various issues, however; the most obvious being any case in which your page.inc was more complex -- eg, has body content intended to appear before the <h2...> pair. That's because this writer tackled the question only to begin acquiring more than my current, mimimal knowledge of HTML::Template.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||