Re: [htmltmpl] Including templates where the name is dtermined at run time
Brought to you by:
samtregar
From: Michael P. <mi...@pe...> - 2004-08-09 00:25:09
|
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. HTH -- Michael Peters Developer Plus Three, LP |