Path

ez.no / exponential / documentation / customization / custom design / examples / common template issues


Common template issues

Here you will find examples of some features you are likely to need when developing your own templates. Consult the eZ template documentation for the complete documentation of the template engine.

In this example we will create an override template for the 'full' view mode of the Folder class. To test it, create a file called 'full_class_1.tpl' in the directory 'design/admin/override/templates/node/view'. Login to the admin interface, create a test folder, and fill it with some articles.

Note: When developing templates you should disable the view cache. When this is enabled, the template engine does not check the modification date of the templates, thus you will not see any changes. Edit settings/site.ini and set ViewCaching=disabled in [ContentSettings].

Just a list

This example simply lists out the names of the articles who are children of the folder we are viewing. The fetch statement fetches a list of children whose parent node id equals our node id, and assigns it to the template variable $children. The name of our node is printed as a header, and then we use a loop to print the name of each child. Looping is done with the section function. Note how we assign a namespace for the loop, called 'Child' in this example.

{* set children variable *}

{let children=fetch('content',list,hash(parent_node_id,$node.node_id))}

 

<h1>{$node.name}</h1>

 

{* loop children and print name *}

{section name=Child loop=$children}

{$Child:item.name}<br>

{/section}

 

{/let}

This will output something like this:
TODO: add screenshot

Comments

Log in or create a user account to comment.

Contents

Customization

Access control
Exponential API Documentation
Content structure
Custom design
    User specified parameters
    Template variables set by Exponential
    Introduction
    Variables, arrays and objects
    Node
    Database connectivity
    Sections
    File placement
    Override templates
    node_view_gui
    Pagination
    Caching
    Stylesheets
    Pagelayout
    Printable pages
    Examples
       Template language
       Creating a navigation path
       Common template issues
          Complex list
          Complex list with colours
          List with links
Components
Tips & Tricks
Troubleshooting


Created

04/07/2003
11:05:07 am
by B�rd Farstad

Last updated

08/07/2003
1:55:49 pm
by B�rd Farstad

Authors

B�rd Farstad



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.