eZ Community » Forums » Extensions » How to include extension template...

How to include extension template result in a regular node template?

How to include extension template result in a regular node template?

Tuesday 20 March 2012 1:20:13 pm - 3 replies

I developed an extension adapting this really useful post : http://share.ez.no/learn/ez-publi...-to-developing-ez-publish-extensions
It works well when I display full pages with the extension's templates.

Now, I need to include the result of a template of this extension in a regular ezwebin template.
(Basically, the result of a call to OptionCarriere's job listing API).

My problem is that the "include template" way below does not seem to process the php side but only shows the template result and the included parameters values.

To make it clear :
{include uri='design:modul1/list.tpl' param_one="consultant" param_two="paris" } does not show the result (jobs ads) that list.php usually creates when thos view parameters are passed in the page url (mydomain.com/index.php/fre/modul1/list/consultant/paris)

I think this question is related to this unresolved one : http://share.ez.no/forums/setup-d...n-another-view/%28language%29/eng-GB
Also, vizualisation functions such as content_view_gui do not apply here givent that I don't want to include the template of an eZ object (but the contant of a custom extension template...)

I'm lost sad.gif Emoticon
Can anyone give me some insights ?

Thanks in adavance for your help,

Modified on Tuesday 20 March 2012 1:21:55 pm by Mickael Robin

Tuesday 20 March 2012 5:17:05 pm

Hi Mickael,

one solution (and prefered one for me) would be ezjscore javascript call to eZ Publish backend which will run the module with your parameters and returns the result which you would include dynamicly into your HTML.

There is a nice tutorial for eZ JS Core server calls right over here: http://share.ez.no/learn/ez-publish/ezjscore-ez-publish-javascript-and-ajax-framework/(page)/9

A second, ugly solution, would be to simpy use an iframe which would display the view page inside it.

Tuesday 20 March 2012 5:53:19 pm

Thanks @Edi for your answer happy.gif Emoticon

I definitely want to avoid iframe and am not good enough at JS/Ajax to try your way (but I plan to learn).

Re-reading the "extension tutorial", I found out that what I need is a custom fetch function (to call a custom php function from a template...)

I found useful infos on how to create custom fetch functions here.

I think I'm gonna be OK now happy.gif Emoticon

Thanks again for your help.


Modified on Tuesday 20 March 2012 5:53:57 pm by Mickael Robin

Friday 04 May 2012 10:07:26 am

Hi Michael,

nice that you find my tutorial about extension development usefull.

For your Problem you can also use a custom tpl operator to execute custom php code (which includeing tpl ...)

Cheers Felix


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

36 542 Users on board!

Forums menu

Proudly Developed with from