Forums / Developer / Unable to use URL parameter

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!