Unable to use URL parameter

Author Message

Albert Hornos

Tuesday 02 August 2005 4:53:14 am

Hi,
I'm trying to get an URL parameter from my url but it's impossible.
I've make the url at this way:

<form action={"content/action"|ezurl} method="post" name="Form-{$Products.product.id}">
		<input type="hidden" name="DestinationURL" value="shop/orderlist">
		<input type="hidden" name="(Producto)" value="{$Products.product.id}">
    <td class="number" align="right"><a href="javascript:;" onclick="document.forms['Form-{$Products.product.id}'].submit()">{$Products.sum_count}</a></td>
		</form>

The result is this:

http://xxx.xxx.com/gestion/shop/orderlist/(Producto)/84

Now I need to get the param "Producto" at orderlist.tpl.
I've tried {$view_parameters|attribute(show)} but the only parameter that it contains is "offset".

Could anybody help me?
Thanks!

Ɓukasz Serwatka

Tuesday 02 August 2005 6:00:22 am

Hi Albert,

You can`t access more parameters because only offset is available for view orderlist of module shop. This is not recommend but if you want to access more variables you will have to hack kernel\shop\module.php and add more params in

$ViewList["orderlist"] = array(
    "functions" => array( 'administrate' ),
    "script" => "orderlist.php",
    "default_navigation_part" => 'ezshopnavigationpart',
    "unordered_params" => array( "offset" => "Offset", "producto" => "Producto" ), //parameters
    "params" => array(  ) );

and also add in orderlist.php file

$producto = $Params['Producto'];

and change line

$viewParameters = array( 'offset' => $offset);

to

$viewParameters = array( 'offset' => $offset, 'producto' => $producto );

Now you should see two params, offset and producto and display it with {$view_parameters.producto}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Albert Hornos

Wednesday 03 August 2005 1:22:36 am

Thank you very much Lukasz,
Perhaps I didn't explain me so well and the solution is so drastic.
The only thing I needed was to pass parameters betewn 2 templates.

I've found another solution easier:
1- Pass the parameters like ?Param=Value
2- At the other template use {def $x=ezhttp('Param',get)}

Anyway Thank you again!

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 22:33:51
Script start
Timing: Jan 18 2025 22:33:51
Module start 'layout'
Timing: Jan 18 2025 22:33:51
Module start 'content'
Timing: Jan 18 2025 22:33:52
Module end 'content'
Timing: Jan 18 2025 22:33:52
Script end

Main resources:

Total runtime1.5129 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.0313152.6250
Module start 'layout' 0.00720.0067 741.656339.4453
Module start 'content' 0.01381.4975 781.1016547.8516
Module end 'content' 1.51130.0016 1,328.953112.1641
Script end 1.5128  1,341.1172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2185160.0002
Check MTime0.00130.0871160.0001
Mysql Total
Database connection0.00090.056810.0009
Mysqli_queries1.441895.3035570.0253
Looping result0.00050.0356550.0000
Template Total1.464896.820.7324
Template load0.00210.137420.0010
Template processing1.462796.683420.7314
Template load and register function0.00020.012010.0002
states
state_id_array0.00150.100810.0015
state_identifier_array0.00090.058120.0004
Override
Cache load0.00170.1124330.0001
Sytem overhead
Fetch class attribute can translate value0.00060.042020.0003
Fetch class attribute name0.00120.077040.0003
XML
Image XML parsing0.00070.044620.0003
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00120.0782180.0001
String conversion0.00000.000940.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs