You currently have provisions for setting Sortable and Default Sort for each field. Unfortunately, Default Sort can only be set for one field. I'm working on an e-commerce view, with three sortable fields: price, # reviews, avg review. When the user first clicks on the view, it will be sorted by price, ascending. This works fine, but if they click on "# reviews" or "avg review", it also sorts these ascending, when naturually I would want them to be sorted by descending (i.e. most/highest reviewed items first). I guess since sort order isn't specified and can't be specified for more than one field, views currently just defaults to ascending.
I propose in the Views "Fields" creation UI, you keep "Sortable" and "Default Sort" like they are, but rename "Default Sort" something like "Sort Order" and then add another column called "Default Sort" that uses a radio or checkbox to only allow one field at a time to be set. I can envision this being a fairly minimal change that wouldn't cause backward compatibility issues,
Does this make sense to anyone but me?
Comments
Comment #1
Vallenwood commentedThis is a great idea and I second it for inclusion in the next release. Just in case the developers are listening!
Comment #2
yched commentedI'm afraid this is a feature request for core's tablesort in the first place, but I'll leave Earl confirm that...
Comment #3
wolfderby commentedok this is a long shot, since I know little about this but would this help maybe?
http://snipplr.com/view/2674/form-alter-to-force-exposed-views-filters-t...
Comment #4
merlinofchaos commentedI'm sorry, yched is right. Core's tablesort featureset does not allow for sorting on multiple fields. The only way to fix this is going to be to provide a more powerful tablesort.
A radio button doesn't work for the default sort field, because there is often simply no default sort, and it's hard to specify "no choice" with the radio buttons as they are.
I realize the UI is pretty bad here. I'll think about ways to fix this in Views 2.