in reply to Variable include names in HTML::Template
If the header, sidebar and footer is static across your templates you could put all that html in a "master" template and have the variable content as a TMPL_VAR. You would then run HTML::Template twice. Once to create the content, populating any params as appropriate, and then supply that to the "master". The heavy lifting is done by your code and you leave HTML::Template to worry about what it looks like.
Any site wide changes, such as adding an additional wrapper around the content (and you can never have too many wrappers imo) would then only need to be added to the "master". You can have a complete site redesign by changing one template and there would then be no need to trouble any of the individual "content" templates. I've learnt at great cost that is a very good thing indeed.
Slightly more work perhaps but I think the flexibility/maintainability it buys you is well worth it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Variable include names in HTML::Template
by dsheroh (Monsignor) on Mar 03, 2008 at 17:38 UTC |