Including non-existing template

Author Message

Radek Kuchta

Friday 07 March 2008 5:07:41 am

Hi all,

In my pagelayout.tpl I am including my own tamplate (which is not exist)

{include uri='design:parts/xxxxxxxx.tpl'}

As we can read in the manual http://ez.no/doc/ez_publish/technical_manual/4_0/concepts_and_basics/designs/design_combinations#automatic_fallback
if the requested file hasn't been found, eZ publish will display an error message.

I didn't create xxxxxxxx.tpl but eZ doesn't give me any error message.
I am using eZ 4.0 and I have enabled Template debug & Debug output.

My question is why eZ doesnt inform me about missing template?

http://ez.no/certification/verify/272582

André R.

Friday 07 March 2008 6:21:12 am

I think it depends on if you are using template compilation or not, template compilation will (if at all) just give you a error when it is compiled I guess.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Radek Kuchta

Monday 10 March 2008 12:35:44 am

Hi André,

I'm using template complilation and template cache.

[TemplateSettings]
TemplateCache=enabled
TemplateCompile=enabled

When I'm runing the page first time (after clearing cache), then eZ inform me:

Notice:
eZTemplate: Loading template "parts/xxxxxxxxx.tpl" with resource "design"

but template doesn't exist.

Mike Melli

Thursday 03 April 2008 2:29:40 pm

Along these same lines, there seems to be a definite bug in the template automatic fallback system in eZpublish 4.0.

I've been working with eZpublish since around 3.8.6 and I've gotten pretty comfortable with the ins and outs of the override system. I often use simple includes such as:

{include uri="design:includes/breadcrumbs.tpl}

Which always automatically used the current site design and found the file successfully with a path such as:

design/plain_site/override/templates/includes/breadcrumbs.tpl

When I tried using this same convention in 4.0, the debug output would say that it was loading the template but it was clearly not.

eZTemplate: Loading template "includes/breadcrumb.tpl" with resource "design"

After struggling to figure out why, I decided to try to give it an explicit override in the siteaccess's override.ini:

[breadcrumb]
Source=includes/breadcrumb.tpl
MatchFile=includes/breadcrumb.tpl
Subdir=templates

This seems pretty pointless to me, as I'm overriding a file with the same file! But it worked.

So, seems like there's something up here. You now have to explicitly set ALL of your overrides, even if they're in the same directory structure as the default templates.

Kristof Coomans

Thursday 03 April 2008 11:49:40 pm

Hi Mike

On a pre-4.0 site it was possible to put non-override templates, like the one you have there, in the override folder. In 4.0 we have restricted this in a way that templates that are loaded by override.ini need to be placed in the override/templates folder and templates that are not loaded by override.ini should be placed in the regular templates folder, so it will be easier to find your templates back (at least if you are aware of this fact) and more predictable which template will be loaded. In your case, you have put a template not loaded by override.ini ({include uri='design:***.tpl'} and no override in override.ini for **.tpl) in the override/templates folder.

See "Step 4: Updating the system configuration", "Custom/override templates location" in the upgrade guide: http://ez.no/doc/ez_publish/upgrading/upgrading_to_4_0/from_3_10_0_to_4_0_0

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

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 19 2025 01:19:15
Script start
Timing: Jan 19 2025 01:19:15
Module start 'layout'
Timing: Jan 19 2025 01:19:15
Module start 'content'
Timing: Jan 19 2025 01:19:16
Module end 'content'
Timing: Jan 19 2025 01:19:16
Script end

Main resources:

Total runtime0.9197 sec
Peak memory usage4,096.0000 KB
Database Queries69

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 589.1563152.6250
Module start 'layout' 0.00670.0035 741.781339.4609
Module start 'content' 0.01020.9080 781.2422688.5234
Module end 'content' 0.91820.0015 1,469.765616.1641
Script end 0.9196  1,485.9297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3640160.0002
Check MTime0.00130.1410160.0001
Mysql Total
Database connection0.00110.119810.0011
Mysqli_queries0.852992.7400690.0124
Looping result0.00090.0930670.0000
Template Total0.886796.420.4434
Template load0.00190.211720.0010
Template processing0.884896.205420.4424
Template load and register function0.00010.009510.0001
states
state_id_array0.00090.099110.0009
state_identifier_array0.00130.139120.0006
Override
Cache load0.00170.1853400.0000
Sytem overhead
Fetch class attribute can translate value0.00060.068550.0001
Fetch class attribute name0.00110.120880.0001
XML
Image XML parsing0.00200.217450.0004
class_abstraction
Instantiating content class attribute0.00000.001580.0000
General
dbfile0.00100.1110290.0000
String conversion0.00000.001240.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs