include does not work??

Author Message

Marek Elsner

Wednesday 17 November 2004 1:12:09 pm

Hello,

I would like to include template in other template.
I have one file first.tpl:

<div class="pagetitle">
New page
</div>

And second file second.tpl:

{include uri="first.tpl"}

I suppose, that after using second.tpl I should see on the screen "New page" title.
But screen is blank...

For sure I am doing something in wrong way, but at the moment I have no idea what it could be...maybe someone can help...

thx

Ole Morten Halvorsen

Wednesday 17 November 2004 1:27:13 pm

Hi,

You need to use the design resource when including a template file.

Example:

{include uri="design:mytemplate.tpl"}

This will include the file mytemplate.tpl which must be inside design/<your-design>/templates/. eZ publish caches every available template, which means you must clear the template override cache everytime you create or override a template. Do this by running

# bin/shell/clearcache.sh --clear-tpl-override

or clear the cache via the admin.

Ole M.

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Marek Elsner

Wednesday 17 November 2004 1:55:12 pm

Thx...now everything is working properly.
:-D

Henrik Heiestad

Friday 19 November 2004 5:06:58 am

Hi I have the same problem on my site. But every .tpl file is located as described in a posting earlier. When I debug, I get this message:

Warning: eZTemplate Nov 19 2004 13:59:06
Function "" is not registered

The webserver stops loading the site at the {include uri="first.tpl"} command.

Any idea why this happens?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.