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.

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 11:39:52
Script start
Timing: Jan 18 2025 11:39:52
Module start 'layout'
Timing: Jan 18 2025 11:39:52
Module start 'content'
Timing: Jan 18 2025 11:39:53
Module end 'content'
Timing: Jan 18 2025 11:39:53
Script end

Main resources:

Total runtime0.7524 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.0057 589.0469152.6250
Module start 'layout' 0.00580.0040 741.671939.4453
Module start 'content' 0.00980.7411 781.1172465.1094
Module end 'content' 0.75090.0014 1,246.22668.1641
Script end 0.7523  1,254.3906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4318160.0002
Check MTime0.00140.1906160.0001
Mysql Total
Database connection0.00080.103210.0008
Mysqli_queries0.709394.2772540.0131
Looping result0.00060.0790520.0000
Template Total0.714995.020.3575
Template load0.00230.302320.0011
Template processing0.712694.717920.3563
Template load and register function0.00010.017910.0001
states
state_id_array0.00110.148510.0011
state_identifier_array0.00180.239220.0009
Override
Cache load0.00190.2521180.0001
Sytem overhead
Fetch class attribute can translate value0.00080.101820.0004
Fetch class attribute name0.00150.194020.0007
XML
Image XML parsing0.00040.052920.0002
class_abstraction
Instantiating content class attribute0.00000.001120.0000
General
dbfile0.00140.1922100.0001
String conversion0.00000.001340.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/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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