Forums / Developer / navigator passing parameter

navigator passing parameter

Author Message

Mazen Alsibai

Sunday 09 October 2005 5:27:55 am

Hi:
i want to send a parameter after offset clause in the navigatior like this:
...../(offset)/8?kind=full
how to do so?
thanks

Sebastiaan van der Vliet

Sunday 09 October 2005 5:44:07 am

Hi Mazen,

You can do it as follows:
.../offset/8/(kind)/full

In the template the parameter is available as:
$view_parameters.kind

Don't forget to check the parameter input in the template, in case someone tries to pass a non-permitted value.

Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.

Mazen Alsibai

Monday 10 October 2005 12:33:07 am

Hi:
the problem is that ez append offset clause after any uri i put it ,is there anyway to avoid that?

Łukasz Serwatka

Monday 10 October 2005 12:35:56 am

Pass $view_parameters variable to navigator instead of $view_parameters.offset. That should do the trick.

{include name=navigator
                     uri='design:navigator/google.tpl'
                     page_uri=$node.url_alias
                     item_count=$list_count
                     view_parameters=$view_parameters
                     item_limit=$page_limit}

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

Mazen Alsibai

Monday 10 October 2005 2:27:39 am

Hi:
my url is ..../products?kind=0
that uri shows some products,
when i use navigator,the offset clause is appended to the end of this uri,and that doesont work,to work correctly it must be inserted between products and ?kind=0.
dous using view_parameters canceled the use of ?kind=0?
thanks

Łukasz Serwatka

Monday 10 October 2005 2:31:40 am

Use mine and Sebastiaan suggestion together.

/products/(kind)/0/

In TPL use {$view_parameters.kind}, this will display value of variable "kind".

When you will pass $view_parameters to navigator module. You will have something like /products/(kind)/0/(offset)/8.

If you still want to use ?kind= then you can try to use concat() function. Something
like

view_parameters=concat( $view_parameters.offset, "?kind=", ezhttp( 'kind', 'get' ) )

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

Mazen Alsibai

Tuesday 11 October 2005 1:42:10 am

Hi:
many thanks for you all,
the first way works correctly,
the second doesnot work
i got something like that:
...products/(kind)/0/(offset)/4/(1)/k/(2)/i/(3)/n/(4)/d/(5)/=
thanks