Forums / Setup & design / Modules: Fetching templates problems with 4.0

Modules: Fetching templates problems with 4.0

Author Message

Tobias Vogel

Monday 18 February 2008 7:32:36 am

Hi all,

I'm trying to transform a design extension to work with ezpublish-4.0 and getting some problems:

The extension contains a module, which fetches a template to put it into the module result's 'content' property. The fetch looks like this:

$tpl = templateInit();
...
$Result['content'] = $tpl->fetch('design:full/foo.tpl');

The according template resides in the directory "EXT_NAME/design/EXT_NAME/templates/full/foo.tpl".

This worked flawlessly with 3.10, but returns the following error with 4.0:

No template could be loaded for "full/foo.tpl" using resource "design"

I remembered the upgrade instructions and moved the template to "EXT_NAME/design/EXT_NAME/overrides/templates/full/foo.tpl" and cleaned the cache, but the behaviour remains the same.

Has anyone an additional idea where the error might be or how to debug/resolve it? (Template debugging doesn't show anything related to this fetch).

Kind regards,
Tobias

Abdelkader RHOUATI

Monday 18 February 2008 10:06:19 am

hi,

verify that you have, in setting of your extension EXT_NAME, file design.ini.append.php width code :

<?php
/*

[ExtensionSettings]
DesignExtensions[]=EXT_NAME

*/
?>

that permit to Take into consideration the design Sets in your extension.

i think this resolve the problem.

tks

Abdelkader.

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery

Tobias Vogel

Monday 18 February 2008 10:32:50 am

Thanks for your reply.

It was an existing extension I tried to convert to ezpublish 4.0, so the settings were alright.

It turned out, the cache messed up my testing results. After some additional tests and much cache cleaning, I have it working now again. Initial reason was, that you have to move templates not mentioned in "override.ini.append.php" from "overrides/templates" to "templates" with ezpublish 4.0.

Carlos Revillo

Monday 18 February 2008 11:51:08 am

Maybe i'm wrong, but where you say
EXT_NAME/design/EXT_NAME/overrides/templates/full/foo.tpl,
shouldn't it be EXT_NAME/design/YOUR_SITEACCESS_HERE/overrides/templates/full/foo.tpl
or maybe
EXT_NAME/design/MY_SITEACCESS_HERE/templates/full/foo.tpl?

Second one works perfect for me...

hope it helps.

Tobias Vogel

Monday 18 February 2008 12:04:13 pm

You're right, the secound one should actually be the DesignName, but my extension and my design have the same name. Your location works for me too, up to and including ezpublish 3.10.0.

With version 4.0 some things seem to have changed. All override-templates (anything mentioned in override.ini.append.php) have to be moved to "override/templates". That's the part, that's mentioned in the upgrade guide from 3.10 to 4.0. In contrary, everything that overrides other templates from base (e.g. ezmatrix.tpl), I had to move from "override/templates" to "templates" in order to work without a pointless override rule like

[myrule]
Source=content/datatype/view/ezmatrix.tpl
MatchFile=content/datatype/view/ezmatrix.tpl
Subdir=templates