📚 Looking for current Exponential documentation? This site contains legacy SDK & API reference docs (eZ Publish era). For up-to-date 2026 product documentation, visit doc.exponential.earth.

  eztemplate / function_include  

<< Delimiter  Sequence >> 

Include

It's possible to include other template files into a template file using the include function. This makes it possible to share template code among different pages or create GUI components by passing variables to the included template.

The include function has two special input parameters. The uri parameter specifies the file to be included, the file does not have to reside as a file but can be put in a database or created dynamically. By default the template engine only loads files by their relative path to the index script, but it's possible to create custom resources as they are called. The name parameter specifies the namespace for the included template, this is useful for avoiding variable name clashes with included files. All other parameters are passed to the included template as template variables in the new namespace.

{* Including a header *}
{include uri='lib/eztemplate/sdk/templates/include_head.tpl' name='head'}

{* Including the body *}
{include uri='lib/eztemplate/sdk/templates/include_body.tpl' name='body' item='Body text'}

{* Include a button *}
{include uri='lib/eztemplate/sdk/templates/include_button.tpl' name='button' item=$button_title}

Exponential Copyright © 1998 - 2026 7x