Thread: [htmltmpl] dynamic <tmpl_include>
Brought to you by:
samtregar
From: Kapoor, N. <nis...@xc...> - 2007-11-02 12:51:01
|
Hello all, I have a need to include a template based on a certain condition i.e., I = would like to be able to do <tmpl_include "<tmpl_var myDir>/my.tmpl"> where I can set myDir. Browsing the archives suggests that this = functionality is presently not available. Since there is a long list of = possible values that myDir can assume, <tmpl_if><tmpl_else> is not a = feasible option. Any suggestions? Thanks, Nishi |
From: Sven N. <sve...@sv...> - 2007-11-02 12:59:07
|
Kapoor, Nishikant schrieb: > Hello all, > > I have a need to include a template based on a certain condition i.e., I would like to be able to do > > <tmpl_include "<tmpl_var myDir>/my.tmpl"> > > where I can set myDir. Browsing the archives suggests that this functionality is presently not available. Since there is a long list of possible values that myDir can assume, <tmpl_if><tmpl_else> is not a feasible option. > > Any suggestions? Change your code to open the other template and paste its output into the template with a simple TMPL_VAR. -Sven |
From: Jason P. <ja...@jo...> - 2007-11-02 13:00:14
|
The way I would do it is make two templates. Instead of the tmpl_include, you would have something like <tmpl_var name="subcontent"> Then in your code, you would create a 'fragment' template object based on the myDir/my.tmpl and then pass that template object output() into your parent template as the 'subcontent' parameter. HTH, Jason Kapoor, Nishikant wrote: > Hello all, > > I have a need to include a template based on a certain condition i.e., I would like to be able to do > > <tmpl_include "<tmpl_var myDir>/my.tmpl"> > > where I can set myDir. Browsing the archives suggests that this functionality is presently not available. Since there is a long list of possible values that myDir can assume, <tmpl_if><tmpl_else> is not a feasible option. > > Any suggestions? > > Thanks, > Nishi > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users |