Executes another template within the current template
|ATTRIBUTECOLLECTION||A structure containing the tag attributes|
|TEMPLATE||The path to the template to execute|
|PAGE||If no TEMPLATE, then the PAGE can be used, which is the URL for include|
|RUNONCE||If this flag is set, then the template is only rendered once, even if included later on in the request, without this flag set|
This tag, as well as its function version RenderInclude(), lets you include any page referenced (rendered as CFML) into the current position of the template. This is another way to split up common functionality.
Consider the following example. The template "runme.inc" would only get executed once, with the engine skipping over the next calls. This works throughout the request, even if the include is called from a different template with a different path.
<cfinclude template="runme.inc" runonce="true" /> <cfinclude template="runme.inc" /> <cfinclude template="runme.inc" />