Forums / Developer / Passing parameters to edit templates

Passing parameters to edit templates

Author Message

Igor Vrdoljak

Friday 30 March 2007 4:21:41 pm

Hi

I need to pass parameters to edit templates, through URL. I have tried using view parameters, but as I can see, these are not supported in 3.8, and I am stuck with this eZ version for now.

I have also tried using query string get parameters, extracting them with ezhttp, but the problem here is that edit templates called with

.../content/edit/[content object id]?var=value

redirect this call to

.../content/edit/[content object id]/version

and query string gets lost in this redirection. I have tried using HTTP_REFERER to get original url, but it seems that the variable is not set while redirecting, so no help there.

Is there a way to pass custom parameters to edit templates, through URL, in eZ Publish versions prior to 3.9?

Thnx

http://www.netgen.hr/eng
http://twitter.com/ivrdoljak

Egil Fujikawa Nes

Monday 16 April 2007 9:03:13 pm

Hi Igor,

I'm not totally sure if this will work, but if you install ezservervars (http://ez.no/community/contribs/template_plugins/ezservervars) you will get the $_SERVER array from PHP, one of the variables is then HTTP_REFERER that you can use in the edit template. With some regex I'm sure you can get your variables from this string.

<b>Notice from php.net about HTTP_REFERER:</b> The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

Good luck :)

BuildCMS - Av. Paulista 777, 15° Andar - CEP: 01311-100 - São Paulo
URL: http://www.buildcms.com