url params into datasource
This is an open discussion with 2 replies, filed under General.
Search
You need to add a filter on the field which matches the url parameter, this is in the "Filter Results" section of the datasource itself. For example, you might have a field called "Kind" in your section, so you would add a filter to the datasource on that field and type "{$kind}" into the value field.
The data source grab()
method accepts an argument $param_pool
, try that.
Alternatively in a data source you can access $this->_env
to get environment variables, which will contain all params.
Create an account or sign in to comment.
How is it possible to get access to url params from out dastasource? That is we have a custom datasource and url parameter $kind, we need to add the value of $kind into database query to filter the ouput results of this DS. How can it be achieved?