Hello,
Can I - and if so - how do i specify a sort order when I use filter=1 in fields.ini?
Currently I think it's sorted by the primary key, but I would prefer it to be sorted alphabetically.
Many thanks, Tom
filter=1 in fields.ini sort order
5 posts
• Page 1 of 1
filter=1 in fields.ini sort orderHello,
Can I - and if so - how do i specify a sort order when I use filter=1 in fields.ini? Currently I think it's sorted by the primary key, but I would prefer it to be sorted alphabetically. Many thanks, Tom
The items are sorted by the field value that it is working with. If you are filtering on a field where an ID is stored in the DB but you are using a vocabulary to associate it with a value, then it will still be sorted on the ID.
If you want to sort on value then you should add a grafted field with the value using the __sql__ directive of the fields.ini file, then use that grafted field as your filter field. E.g. __sql__ = "select a.*, b.foo_name from a left join b on a.foo_id=b.foo_id" [foo_name] filter=1 Best regards Steve
Re: filter=1 in fields.ini sort orderIs it possible to sort the filter selection list in reverse (descending)?
This is particularly an issue for date fields, since the latest dates are at the bottom of the list by default. Thanks, Alan
Re: filter=1 in fields.ini sort orderI don't think so currently.
5 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 13 guests |