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.

eZ debug

Timing: Jan 18 2025 22:40:17
Script start
Timing: Jan 18 2025 22:40:17
Module start 'layout'
Timing: Jan 18 2025 22:40:17
Module start 'content'
Timing: Jan 18 2025 22:40:17
Module end 'content'
Timing: Jan 18 2025 22:40:17
Script end

Main resources:

Total runtime0.8235 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00040.0049 587.8047152.6094
Module start 'layout' 0.00530.0036 740.414139.4141
Module start 'content' 0.00890.8134 779.8281546.9453
Module end 'content' 0.82230.0012 1,326.773412.1875
Script end 0.8235  1,338.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3630160.0002
Check MTime0.00120.1511160.0001
Mysql Total
Database connection0.00060.067710.0006
Mysqli_queries0.776594.2892620.0125
Looping result0.00050.0645600.0000
Template Total0.788795.820.3944
Template load0.00200.244220.0010
Template processing0.786795.526920.3934
Template load and register function0.00020.019110.0002
states
state_id_array0.00080.096910.0008
state_identifier_array0.00140.174920.0007
Override
Cache load0.00160.1989340.0000
Sytem overhead
Fetch class attribute can translate value0.00060.067930.0002
Fetch class attribute name0.00100.116740.0002
XML
Image XML parsing0.00030.041530.0001
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00060.0732100.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs