cannot include overridden folder.tpl in template.

Author Message

M Unicorn

Wednesday 27 May 2009 8:08:21 am

The basic idea is to override a specific node's folder template and implement a sort_order parameter, then include the default folder code ie. {include uri="design:full/folder.tpl}. This way I don't have to duplicate the full folder template for small code changes. btw, my overridden folder.tpl is in "design/sitedesign/override/templates/full/folder.tpl (and works great if called as a folder directly).

A bit more specific, the override.ini.append.php has this entry:

[FULL_folder_events]
Source=node/view/full.tpl
MatchFile=full/events_folder.tpl
Subdir=templates
Match[node]=100

And I have a template the rule matched above, the rule is working and pulling the right template, events_folder.tpl which is basically this:

{include uri="design:/full/folder.tpl"}

I keep getting:
Warning: eZTemplate May 27 2009 15:05:32
No template could be loaded for "full/folder.tpl" using resource "design"

I've tried many variations of the path starting from /design right down to trying to call folder.tpl with no path. I've also tried using "full/folder.tpl"|ezdesign('no') and various paths with no luck.

I'm wondering if the override is overriding the overridden folder.tpl? Say that 10 times fast!

Any help is appreciated
M Unicorn.

Norbert Wagner

Friday 05 June 2009 4:04:42 pm

Hi M Unicorn,
we had similar problems.

It seems that you cannot include templates located in the override/templates folder.
IIRC, in the past this was possible.

We solved our problem with a dumb override which in your case should look like this:

[dummy_folder]
Source=full/folder.tpl
MatchFile=full/folder.tpl
Subdir=templates

Although we did not use it for class templates, but for menus included in the pagelayout.

Hope this helps,
Norbert

Russell Michell

Sunday 07 June 2009 4:04:53 pm

@M Unicorn,

Are you *sure* the right template is being included?

FWIW - while developing, in override/settings.ini.append.php, I usually use ez with the [TemplateSettings] DevelopmentMode=enabled setting which - where viewing the source for a page - ez will show you HTML comments of the *exact* path where a particular template is being included from:


<!-- START: including template: extension/ezdeploy/design/duty/templates/link.tpl (design:link.tpl) -->
<!-- some HTML code here from extension/ezdeploy/design/duty/templates/link.tpl
<!-- STOP: including template: extension/ezdeploy/design/duty/templates/link.tpl (design:link.tpl) -->

Simply seeing "{include uri="design:/full/folder.tpl"}" is not a precise way of ensuring you know where a template is included from especially in the case of overrides, design extensions etc.

Forgive me if you knew this already, Grandma eggs etc ;-)

Cheers,
Russell

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Norbert Wagner

Thursday 26 November 2009 4:20:49 am

Read link below for more info:

http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_functions/miscellaneous/include#comment20195

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