Parameters in template call

You need to be logged in to post messages in the forums. New users may register here.

Sander van den Akker

Member since:
09 January 2008

Posts: 20

Tuesday 26 January 2010 7:42:43 am

I'm building a simple ajax imagegallery to master this extension, and I thought I'd start with the 'simplified' version: TemplateFunction=true. By calling templates only I don't have to bother with the API yet.

The current urls my script generates are like /ezjscore/call/gallery::view::<node_id>. How do I access the node_id parameter from my templates/gallery/view.tpl template? Or is this not possible yet?
Up

Sander van den Akker

Member since:
09 January 2008

Posts: 20

Tuesday 26 January 2010 8:32:56 am

I have a really dirty workaround by putting the $_SERVER var in an autoload operator. Now I can access the parameters by using the REQUEST_URI variable.

When using a clean approach with postvariables, like in the esjzcore_demo extension, the problem persists. Ezjscore doesn't seem to pass on post variables. I guess that makes my post a feature request ;-)
Up

Gaetano Giunta

Member since:
09 January 2008

Posts: 152

Tuesday 26 January 2010 8:44:26 am

Unfortunately, passing vars in POST is not really well supported, as those will not be encapsulated and will have to be later fetched in $_POST. It is imho a bad design that should be fixed sooner or later (see http://projects.ez.no/ezjscore/fo..._of_standard_rpc_protocols#msg20752)

Otoh the vars put in the GET should arrive in your template - even though I do not remember right now the name of the variable storing them...
Up

André R.

Member since:
14 January 2008

Posts: 145

Wednesday 27 January 2010 1:23:38 am

Commited some more example code in ezjscore/design/standard/templates/ezjsctemplate/test.tpl:

































eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

Sander van den Akker

Member since:
09 January 2008

Posts: 20

Wednesday 27 January 2010 2:30:02 am

I didn't know about the ezhttp operator. Thanks for your help both!
Up

You need to be logged in to post messages in the forums. New users may register here.