in reply to Re: Template Toolkit "Pre-Processor"
in thread Template Toolkit "Pre-Processor"

To build on this solution, to properly handle passing parameters I think you need to replace

[% INCLUDE file var1=val1 var2=val2 ... %]

with:

[% BLOCK _inline_file %] ...contents of file... [% END BLOCK %] [% INCLUDE _inline_file var1=val1 var2=val2 ... %]

and the same for PROCESS directives. There can be complications if you use INCLUDE and PROCESS with BLOCK identifiers. In that case you'll have to determine if the template argument refers to a file or a BLOCK. Finally, if you include or process a template file twice you'll want to make sure you don't define the corresponding inlined block twice.

btw, this would be an excellent question for the template toolkit list.