Views exposed sort handler with asc + desc + inactive I have a view with the following sort handlers:


price (exposed, asc/desc, default=asc)
stock (desc)


I would like to have a third option for price so that it can be inactive/asc/desc, with "inactive" being the default.

So by default it sorts by stock availability (or any other sort handlers I may configure in the future), and only if the user chooses "cheapest first" it will sort by price.

(I am going to use Better exposed filters to display the sort options as links, but this is secondary)
Things to learn:


If more than one sort option is exposed, then only one of them will be active at a time.
The first of all exposed sort option will be active by default, the others will be inactive by default.
The non-exposed sort options will always be active. But if you put them below the exposed sort options, they will have a lower priority, obviously, so you might not see the effect.
One field can be used multiple times. E.g. one time exposed, another time not exposed.
BEF can be used to re-label the options.
BEF can be used to hide some sort options, by leaving the label empty.


Example sort configuration:


stock, exposed, descending.
amount, exposed.
stock, descending. (not exposed)


Then in the BEF settings, "Advanced sort options", "Rewrite the text displayed":

Stock Desc|No sort
Stock Asc|
Price Asc|Cheapest first
Price Desc|Most expensive first