Thursday 26 August 2010 12:39:43 pm - 10 replies
Hi all, I'm trying to do a simple extension. 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=eZTemplate::instance();
$Result ['content'] = $tpl->fetch ('design:jacextension/plan.tpl');
The template resides in the directory /extension/jacextension/design/jacextension/templates/plan/plan.tpl
The extension is set as a design extension:
<?php /* #?ini charset="utf-8"? # transmit to eZ, to search for designs in jacextension [ExtensionSettings] DesignExtensions[]=jacextension */ ?><?php /* #?ini charset="utf-8"? # transmit to eZ, to search for designs in jacextension [ExtensionSettings] DesignExtensions[]=jacextension */ ?>
I clear all cache too, but the debug output is always the same.
The debug output is:
No template could be loaded for "jacextension/plan.tpl" using resource "design"
Has anyone an additional idea where the error might be or how to debug/resolve it?
Kind regards,
Daniel Perdomo
Modified on Thursday 26 August 2010 12:46:23 pm by Daniel Perdomo Lorenzo
Thursday 26 August 2010 1:46:48 pm
thanks, i change the directory of the template:
extension/jacextension/design/jacextension/templates/jacextension/plan.tpl and i put the same fecth but still fail. i add jacextension in my design.ini.append.php and I have a module called jacextension with a view called plan.
/jacextension/setting/design.ini.append.php
<?php /* #?ini charset="utf-8"? # transmit to eZ, to search for designs in jacextension
[ExtensionSettings] DesignExtensions[]=jacextension ?>
Modified on Thursday 26 August 2010 1:55:18 pm by Daniel Perdomo Lorenzo
Thursday 26 August 2010 2:06:36 pm
Now i changed to eZTemplate::factory() but still fails :S . I tried a lost of directory but all of them fails:
extension/jacextension/design/templates/jacextension/plan.tpl
extension/jacextension/design/jacextension/templates/jacextension/plan.tpl
extension/jacextension/design/jacextension/templates/plan/plan.tpl
the url: http://localhost/pfc/index.php/jacextension/plan/ the default siteaccess is esl(Website Interface)
thanks a lot!!!
Thursday 26 August 2010 2:44:47 pm
I don't get it... does it work or not ?
The template string you're looking for is plan/plan.tpl. You might wanna consider moving your extension templates to a subfolder so that they can't conflict, like /extension/jacextension/design/standard/templates/jacextension/plan/plan.tpl.
Note that the string above uses the standard design as opposed to your custom jacextension one. This is on purpose, as it will make the extension portable to any eZ Publish.
Thursday 26 August 2010 4:20:55 pm
thanks Bertrand but when i move the plan.tpl to subfolder
/extension/jacextension/design/standard/templates/jacextension/plan/plan.tpl and look for 'plan/plan.tpl'
( $tpl->fetch('plan/plan.tpl') )
don't work again.
with $tpl->fetch('jacextension/plan/plan.tpl') dont work too. The debug output is:
Notice: | Aug 26 2010 14:20:33 |
eZTemplate: Loading template "plan/plan.tpl" with resource "design" |
|
Warning: eZTemplate | Aug 26 2010 14:20:33 |
No template could be loaded for "plan/plan.tpl" using resource "design" |
Thursday 26 August 2010 5:46:21 pm
Thanks for reply, but this call don't work too with the structure /extension/jacextension/design/standard/templates/jacextension/plan/plan.tpl . I don't know why it doesn't work i desperate for this.
$tpl->fetch('design:jacextension/plan/plan.tpl');
Modified on Thursday 26 August 2010 5:47:33 pm by Daniel Perdomo Lorenzo
You must be logged in to post messages in this topic!