Change page params
This is an open discussion with 3 replies, filed under General.
Search
Where are you trying to grab these parameters? In a custom event or in the data source? If it's in the data source then I think you'd actually need to parse the XML, grab the values, optionally modify them, and then spit them back out as XML to the page.
Where are you trying to grab these parameters?
I have my own extension which uses FrontendParamsResolve
to add various params
to support the pool.
Some background info:
Page parameters one
two
three
follows the relative URL, that is with an URL /page/subpage/subsubpage/
, $one
is page
, $two
is subpage
and so on. They are usual page parameters (of index
page).
I had an idea that everytime the last of the defined parameters would be of numeric value, e.g. /page/2/
or /page/subpage/2/
, I would use that number for DS
pagination and not to use it in that case for DS
filtering. 'Cause I want to try pagination in this style and not like ?p=2
, that is like {$url-p}
.
I can not define a pagination
page parameter, because the number can be given at any level. The whole page like structure goes from a single index
page and is fluid.
Well, I can define a pagination
value in that extension based on that, but I can not empty the numeric page param to a NULL
or ""
; the DS filtering process still counts with the 2
from the request and because of that it fails to match.
Crazy idea no? :/
This is quite easily done with the URL Router extension. You can just make it so that when a numerical regex matches, the (numerical) value is replaced by &pagination=$value. You can then use the $url-pagination parameter in your data-sources.
Something like: ^/(.*)\/([0-9]+)$/
to /$1&pagination=$2
should do the trick (untested!)
Create an account or sign in to comment.
I have page parameters
one
two
three
which are being used by datasource filters.I would like to catch those parameters prior to be used for ds evaluation to optionally change their value.
What delegate can I use and, secondly, how do I correctly address those variables?
So far I've used
FrontendParamsResolve
and e.g.$context['params']['one']
to get the value, but after setting it to e.g. an empty value like$context['params']['one'] = ""
, the datasource still used the former$one
value that came by the GET request.EDIT:
I had an idea, it will ignore that parameter and move along.