[htmltmpl] Passing variable to included template?
Brought to you by:
samtregar
From: Bas A. S. <B.S...@ya...> - 2006-07-20 19:34:03
|
Hi all, I've been using H::T for some time for simple stuff but I'm using it for something more complicated now. What I'd like to do is have one site-wide header template that gets included from individual pages receive a variable from the individual page's template. Something like: site-wide.tmpl: <table> <tr> <td>(Title of subpage)</td> </tr> .... </table> Then individual pages have this: <html> <body> <TMPL_INCLUDE NAME="header.tmpl"> ... </body> </html> Now what I'd like to do is set a variable in the individual page containing the "nice" title of the page. I don't want to set that name from code (it's a generic handler that basically calls H::T->new and sticks in some user properties. Ideally, I'd like to be able to set a variable in the individual page and do this in site-wide.tmpl: <table> <tr> <td><TMPL_VAR NAME="title"></td> </tr> .... </table> And set the value for "title" in the individual page's template: <html> <body> <TMPL_SET_VAR title="abc"> <TMPL_INCLUDE NAME="header.tmpl"> ... </body> </html> From the perldoc, I can't find it and searching the mailing list won't work ("Unable to contact search server" etc.). A quick browse did reveal some info but not quite something as simple as I need now :) Thanks, Bas. |