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.