{include} {include} tags are used for including other templates in the current template. Any variables available in the current template are also available within the included template. The {include} tag must have the attribute "file", which contains the template resource path. You can optionally pass the 'assign' attribute, which will specify a template variable name that the output of {include} will be assigned to instead of displayed. Attribute Name Type Required Default Description file string Yes n/a The name of the template file to include assign string No n/a The name of the variable that the output of include will be assigned to [var ...] [var type] No n/a variable to pass local to template function {include} {$title} {include file='page_header.tpl'} {* body of template goes here *} {include file="$tpl_name.tpl"} <-- will replace $tpl_name with value {include file='page_footer.tpl'} ]]> You can also pass variables to included templates as attributes. Any variables explicitly passed to an included template as attributes are only available within the scope of the included file. Attribute variables override current template variables, in the case they are named alike. {include} passing variables where header.tpl could be

{$title}

]]>
{include} and assign to variable This example assigns the contents of nav.tpl to the $navbar variable, which is then output at the top and bottom of the page. {include file='nav.tpl' assign=navbar} {include file='header.tpl' title='Main Menu' table_bgcolor='#effeef'} {$navbar} {* body of template goes here *} {include file='footer.tpl' logo='http://my.example.com/logo.gif'} {$navbar} ]]> Use the syntax for template resources to include files outside of the $template_dir directory. {include} template resource examples See also {include_php}, {php}, Template Resources and Componentized Templates.