eZ Community » Forums » Extensions » Showing the result in a template...
expandshrink

Showing the result in a template outside the extension

Showing the result in a template outside the extension

Wednesday 26 October 2011 6:26:12 pm - 4 replies

Hi there,

I'm trying to do something like this in my own extension, but it doesn't work:

$Result['content'] = $tpl->fetch( 'design:my_site/override/templates/full/template.tpl' );

where 'template.tpl' is in folder '/design/my_site/override/templates/full/template.tpl'

and the code of the extension in '/extension/my_extension/modules/my_extension/insert.php'

I know that the modules of the extension show the result into the extension's templates but is there any way to show it in an external template?

Thanks in advance.

Greetings

Wednesday 26 October 2011 9:46:51 pm

It must be:

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

And the template:
 /design/my_site/templates/full/template.tpl

The template can be on the extension or on other extension or design.

Thursday 27 October 2011 10:13:33 am

Thanks for the response Israel, your code works perfectly.

But I'm trying execute my own extension inside an overrided template of an article and when the extension is executed show the result into the same template of this article in order to maintain the path and the elements of the left menú.

If I use:

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

the result is showed in this template but in my left menu and path nothing appear.

How can I do this?

Thanks

Modified on Thursday 27 October 2011 10:14:45 am by Alex Muñoz

Tuesday 01 November 2011 1:55:57 pm

I'm a bit confused.

But I think what you want is to develop a template operator instead of an extension.

Wednesday 02 November 2011 10:34:07 am

Hi Quoc-Huy,
I think I have not explained correctly, I want to show the same menu into the extension templates like if this templates were in content tree, in other words, what can I put into the $Result[] to show the path and left menu like if the extension template was in content tree?
I found the solution, putting into $Result['path'] (in file '/extension/my_extension/modules/my_extension/file.php') the path that you want to show into the extension template
If there is someone interested, these links can help:
http://ezpedia.org/ez/module
http://share.ez.no/learn/ez-publi...-to-developing-ez-publish-extensions
http://share.ez.no/learn/ez-publi...tom-admin-modules-views/%28page%29/5

 

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from