include

Summary

Includes a file.

Usage

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

Parameters

NameTypeDescriptionRequired
uri string Path to the included file Yes.
name string namespace for the included template No.
other parameters mixed Parameters passed to the included template No.

Returns

Description

Includes a file in this template. The uri parameter specifies the file to be included. 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. This makes it possible to share template code among different pages or create GUI components by passing variables to the included template. A typical usage is to include another template file located under design folder by specify uri="design:path_to_file".

Examples

Includes file edit_validation.tpl which located in folder design/mydesign/templates/content into the current template. If the file is not located under design/mydesign, then the file design/standard/content/edit_validation.tpl will be included. Here we assum that the current file belongs to design/mydesign.

{include uri="design:content/edit_validation.tpl"}

Includes file google.tpl and pass different parameter to that template.

{include name=navigator

           uri='design:navigator/google.tpl'

           page_uri=concat('/content/view','/full/',$node.node_id)

           item_count=50

           view_parameters=$view_parameters

           item_limit=10}

Comments

log in or create a user account to comment.

Contents

Reference

Database diagram
Template operators
Template functions
    GUI
    Miscellaneous
       cache-block
       fetch_alias
       include
       ldelim
       literal
       rdelim
       run-once
    Program flow
    Variables
Data fetching
Modules
XML tags


Created

06/02/2004
2:19:21 pm
by Balazs Halasy

Last updated

20/04/2004
9:41:41 am
by Kåre Køhler Høvik

Authors

Balazs Halasy
Wenyue Yu
Kåre Køhler Høvik



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.