Re: [htmltmpl] Including templates where the name is dtermined at run time
Brought to you by:
samtregar
From: simran <sim...@re...> - 2004-08-09 00:36:37
|
> Dan Horne wrote: > > Hi all > > > > I wish to include a template within another template. However, the > > template name to be included is determined at run time. I've tried: > > > > <TMPL_INCLUDE NAME=SUB_CONTENT> > > > > but I get "Cannot open included file SUB_CONTENT : file not found" > > > > I tried > > > > <TMPL_INCLUDE NAME=<TMPL_VAR NAME=SUB_CONTENT>> > > > > but that doesn't parse (as I expected). > > > > Is there a way to do this? > > Not in the way that you want to do it. That would, in essence > require H::T to do two passes when parsing which it doesn't do. > What you would have to do is process the first template (whose > name is determined at run time) and keep the output in a scalar. > Then load this scalar into the second, outer template. Excellent suggestion.. the other way would be to use a filter (HTML::Template docs for more details...) |