Forums / Cotonti / Support / Include a template inside another include

tensh
#1 2010-04-28 19:34
Hi;

I can easily include one template file:

{FILE "plugins/myplug/functions/tpl/master.tpl"}

But what if the contents of this file are like this:

<!-- IF {FUNIDTXT} == "myfunction" --> 
{FILE "plugins/myplug/functions/tpl/myfunction.tpl"} 
<!-- ENDIF -->  

It looks like the IF statement is interpreted, but instead including another file, the text {FILE "plugins/myplug/functions/tpl/myfunction.tpl"} is returned.

Is inability to nest template inclusion an expected thing?
I just want to make something like a "subplugin" thing, which generates the master tpl depending on the functions in the system (database).
Trustmaster
#2 2010-04-28 22:54
The way FILE works is really simple, so it doesn't look for FILEs within the included FILE. I can make it support nested FILEs for the price of a bit of perfromance (as always).
May the Source be with you!
tensh
#3 2010-04-29 20:18
I think it's not neccessary.
I have just solved it by just defining a new template in the wrapper function with a filename dependant on subfunction params.