[htmltmpl] TMPL_SET -- this would be nice to have.
Brought to you by:
samtregar
From: Dmitri T. <dti...@vo...> - 2006-05-17 12:50:49
|
Dear List, In most of my templates, I have a header and a footer templates that get included from the main template, which I assume is a very common scenario. My problem is that <title> tag is in the header template and it needs to change for each template. There are two approaches that I can currently use: 1. Put <title> tag into main template. This works, but I do not believe having <title> outside of <head> is correct HTML[1]. 2. Set title from CGI script. This is not very convenient and, in my mind, breaks the paradigm. The best solution, in my mind, would be something like this: ---- template search_results.tmpl ---- <TMPL_SET NAME='TITLE' VALUE='Search Results'> <!-- this is where title is used --> <TMPL_INCLUDE NAME="_header.tmpl"> <some_html_here> <TMPL_INCLUDE NAME="_footer.tmpl"> ---- end of template ---- Questions: 1. Is this feasible to implement? 2. Is such feature compatible with HTML::Template philosophy? 3. (Bonus question) is there another approach besides the two above that I can use right now? Thank you, - Dmitri. 1. http://www.w3.org/TR/html401/struct/global.html#h-7.4.2 |