4 users online. Create an account or sign in to join them.Users
Dynamic Datasource sorting?
This is an open discussion with 3 replies, filed under General.
Search
I think if you customise the DS you can. For exampe you may have:
public $dsParamSORT = 'system:id';
Change to:
public $dsParamSORT = '{$url-sort-field}';
And you should be able to filter on /page/?sort-field=title. Just remember that if you save your DS through the editor, your customisation will be lost.
Cool! Thanks a bunch! Now I don’t have to duplicate all of my code and make separate datasources! Will try it out soon.
One follow-up question though, how might I choose the default field to sort on if no URL parameter exists?
DS filters use a colon to specify a fallback, so you could try it here.
{$url-sort-field:title}
Create an account or sign in to comment.
I know its possible to sort via XSL, but that breaks down when using pagination. Is it possible to use a URL parameter to change which field is sorted on?
It looks like according to the last Symphony update, you can change the order ASC or DESC based on URL parameters, so that’s cool. Just wondering if changing the sort field would also be possible?