Forums / Setup & design / Passing variables in url

Passing variables in url

Author Message

Alexander Petrov

Thursday 13 September 2007 12:26:58 am

I'm trying to pass variables to a form inside another document through the url.
Here is a link:

<a href={concat("/some_url/","/(param1)/",$node.data_map.attr1.content,"/(param2)/",$node.data_map.attr2.class_content.options[$node.data_map.attr2.value[0]].name)|ezurl}><img class="buy" src={"images/content/desc/buy.gif"|ezdesign} alt="" /></a>

First variable compares with elements values and if it equal put the "selected" attribute to make the needed option selected. But it's now working (.

<SELECT name="(filter)" size="1">
          {def $classAttribute=fetch( 'content', 'class_attribute', hash( 'attribute_id', 240 ) )}
              {def $options=$classAttribute.content.options}
                 {foreach $options as $option}
                   <option value="{$option.id}" {if eq($view_parameters.param1, $option.name}selected{/if}>{$option.name|wash( xhtml )}</option>
                 {/foreach}
		       {undef $options}
             {undef $classAttribute}
</SELECT>

Second variable come to input field value. I don't know how to put parameters in the {attribute_view_gui} so I just take the output code of the text field attribute at put the url variable insude the value="".

<input class="box" size="70" name="ContentObjectAttribute_ezstring_data_text_554" value="{$view_parameters.param2}" type="text">

The variable is displaying in the output html code, but is not visible on the rendered page. When I remove the "name="ContentObjectAttribute_ezstring_data_text_554" attribute the value is visible.

Need your help, please!

Olivier Ouin

Thursday 13 September 2007 8:55:57 am

First, we need to know what datatypes your using. I think that in your case, attr1 is a ezselection one.

If it's the case, you have to know that $node.data_map.attr1.content will contain the index of the selection, and not the text.
So you should test equality between $view_parameters.param1 and $option.id, and not $option.name.

Another thing, whatever which datatype is used, there is a missing parenthesis in {if eq($view_parameters.param1, $option.name}selected{/if} : the eq operator is not closed.

I don't see what could be the problem in your usage of the second parameter, but maybe it's related to the problem above ... the HTML generated code is maybe a bit altered by it.

eZ debug

Timing: Jan 18 2025 05:01:25
Script start
Timing: Jan 18 2025 05:01:25
Module start 'content'
Timing: Jan 18 2025 05:01:26
Module end 'content'
Timing: Jan 18 2025 05:01:26
Script end

Main resources:

Total runtime1.2233 sec
Peak memory usage4,096.0000 KB
Database Queries191

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.7109180.8359
Module start 'content' 0.00541.0507 768.5469470.1875
Module end 'content' 1.05610.1672 1,238.7344333.4766
Script end 1.2232  1,572.2109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3198210.0002
Check MTime0.00140.1180210.0001
Mysql Total
Database connection0.00060.048810.0006
Mysqli_queries1.154994.40901910.0060
Looping result0.00220.18131890.0000
Template Total1.190997.420.5955
Template load0.00210.168620.0010
Template processing1.188897.184720.5944
Template load and register function0.00020.017210.0002
states
state_id_array0.00090.069810.0009
state_identifier_array0.00220.183920.0011
Override
Cache load0.00170.1389180.0001
Sytem overhead
Fetch class attribute can translate value0.00210.175230.0007
Fetch class attribute name0.00120.094720.0006
XML
Image XML parsing0.00050.041030.0002
class_abstraction
Instantiating content class attribute0.00000.000620.0000
General
dbfile0.00420.3450210.0002
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs