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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:26:21
Script start
Timing: Jan 18 2025 19:26:21
Module start 'layout'
Timing: Jan 18 2025 19:26:21
Module start 'content'
Timing: Jan 18 2025 19:26:22
Module end 'content'
Timing: Jan 18 2025 19:26:22
Script end

Main resources:

Total runtime1.2604 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 587.9375152.6250
Module start 'layout' 0.00630.0048 740.562539.4453
Module start 'content' 0.01121.2478 780.0078527.1719
Module end 'content' 1.25900.0014 1,307.179712.1563
Script end 1.2604  1,319.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2822160.0002
Check MTime0.00140.1084160.0001
Mysql Total
Database connection0.00100.077410.0010
Mysqli_queries1.201595.3306540.0223
Looping result0.00080.0611520.0000
Template Total1.213296.320.6066
Template load0.00270.216820.0014
Template processing1.210596.040520.6052
Template load and register function0.00010.008610.0001
states
state_id_array0.00270.214410.0027
state_identifier_array0.00220.172820.0011
Override
Cache load0.00230.1802190.0001
Sytem overhead
Fetch class attribute can translate value0.00100.077420.0005
Fetch class attribute name0.00160.124140.0004
XML
Image XML parsing0.00160.123220.0008
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00110.0881220.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs