Share » Forums » Extensions » Modules: Fetching templates problems...

Modules: Fetching templates problems with 4.3

Modules: Fetching templates problems with 4.3

Thursday 26 August 2010 3:39:43 am - 10 replies

Modified on Thursday 26 August 2010 3:46:23 am by Daniel Perdomo Lorenzo

Author Message

Ivo Lukac

Thursday 26 August 2010 4:23:57 am

Hm, your path to template is wrong. Try this:

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

if you added jacextension in your design.ini

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

André R.

Thursday 26 August 2010 4:46:40 am

And it should be (for eZ Publish 4.3+ only):

$tpl = eZTemplate::factory();

Or using old syntax (so it works on older eZ Publish versions also):

require_once( 'kernel/common/template.php' );
$tpl =templateInit();

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

Daniel Perdomo Lorenzo

Thursday 26 August 2010 4:46:48 am

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 ?>

Daniel Perdomo Lorenzo

Thursday 26 August 2010 5:06:36 am

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!!!

Bertrand Dunogier

Thursday 26 August 2010 5:44:47 am

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.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Daniel Perdomo Lorenzo

Thursday 26 August 2010 7:20:55 am

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"

Peter Keung

Thursday 26 August 2010 8:28:21 am

Using your folder structure, the call should be:

$tpl->fetch( 'design:jacextension/plan/plan.tpl' );

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

Daniel Perdomo Lorenzo

Thursday 26 August 2010 8:46:21 am

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');

André R.

Thursday 26 August 2010 3:17:26 pm

The last try looks correct, is the extension activated, is it configured to be an DesignExtension, did you clear cache (specifically template override cache)?

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

Daniel Perdomo Lorenzo

Friday 27 August 2010 1:01:40 am

I found the problem. it was that the charset in design.append.ini.php was set to iso-8859-1 and I needed utf-8. :))))

Thanks all for help me!!!!!

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu