Prefill ezSurvey fields with GET-parameters

Author Message

Reinhard Hutter

Thursday 07 April 2011 3:53:12 am

I'm trying to dynamically preselect / prefill certain fields of an ezSurvey by passing the values as GET parameters to the form, but so far I've failed. I've done trial & error with all variations of the "ContentObjectAttribute_ezsurvey_answer" parameter, e.g.

http://www.domain.com/my_survey?ContentObjectAttribute_ezsurvey_answer_1797_672=Product1
http://www.domain.com/my_survey?ContentObjectAttribute_ezsurvey_answer_1797=Product1
http://www.domain.com/my_survey?ContentObjectAttribute_ezsurvey_answer_672=Product1

Is this possible at all with ezSurvey? (I need a dynamic preselection, depending on which page is linking to the survey, another value should be passed to the survey).

Peter Keung

Thursday 07 April 2011 8:09:03 am

You can override any of the question type templates here:

extension/ezsurvey/design/standard/templates/survey/view/

You could then, for example, add another condition within the "value" field for a text entry to do a fallback check for your important GET variable (or eZP view parameter) with the ezhttp and ezhttp_hasvariable template operators.

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

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 29 2025 14:44:32
Script start
Timing: Jan 29 2025 14:44:32
Module start 'layout'
Timing: Jan 29 2025 14:44:32
Module start 'content'
Timing: Jan 29 2025 14:44:32
Module end 'content'
Timing: Jan 29 2025 14:44:32
Script end

Main resources:

Total runtime0.0152 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.2578151.2266
Module start 'layout' 0.00530.0022 739.484436.6875
Module start 'content' 0.00750.0063 776.171990.1719
Module end 'content' 0.01380.0014 866.343829.9766
Script end 0.0151  896.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002415.9374140.0002
Check MTime0.00106.7249140.0001
Mysql Total
Database connection0.00085.144710.0008
Mysqli_queries0.002013.467230.0007
Looping result0.00000.073910.0000
Template Total0.00106.810.0010
Template load0.00085.176210.0008
Template processing0.00021.575510.0002
Override
Cache load0.00053.468610.0005
General
dbfile0.001812.088280.0002
String conversion0.00000.047240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs