Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.



Includes a file.


{include uri='path_to_file' [ name='namespace' ] [ parameter(s)='value(s)'  ]}


uri string Path + name of the file that should be included. Yes.
name string Alternative namespace for the included template. No.
other parameters any Parameters that will be passed to the included template. No.


This function includes a file in the template from where the function was called. The "uri" parameter must be used to specify the target file. In most cases, the value of this parameter starts with a "design:", which tells the system to look for the desired template within the current (and fallback) design resources. The "name" parameter can be used to specify an alternative namespace for the included template, this is useful for avoiding variable name clashes when including other templates. All other parameters will be passed to the included template as template variables. This function makes it possible to share template code among different parts of the solution.


Example 1

{include uri='design:example/menu.tpl' something='Hello world'}

This example demonstrates how to include a template called "menu.tpl" (which is located within the "example" subdirectory of the "templates" directory. If eZ Publish is unable to find the template in the current design, it will automatically attempt to locate it in one of the fallback designs or the standard design. The value of the "something" parameter will be available through a variable called $something within the template that is included.

Balazs Halasy (06/02/2004 1:19 pm)

Balazs Halasy (28/04/2005 1:55 pm)


  • What schemas does the URI attribute support

    'In most cases, the value of this parameter starts with a "design:"...'

    What are the 'other' cases? Does this function support other URI schemas such as 'http:'?