Calls a template from within the current template.


include str_expr


The name of the external template file to execute.


Example 1
{include "/your_dir/example1.tpl"}
Example 2
{file_name = "example1.tpl"}
{include file_name}


The include statement enables you to call a template from within a template. When Templex encounters an include statement, execution passes from the current template to the specified template. When Templex encounters either an exit statement in the included template or the end of the included template, control returns to the template containing the include statement.

Templates called with an include statement can also contain include statements, creating a chain of nested templates. There is no limit to the number of templates that can be nested within each other.

When a template is included in a template, Templex checks the current directory for the template. If the template is not found, Templex checks the list of paths.

str_expr can be either literal text or a string variable. If str_expr is literal text, it must be placed between double quotes.