Views Sort Expression
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
This is an advanced module as it basically requires you to know the SQL of the view and how to construct expression-based ORDER BYs.
It aims to be a helper module which provides custom ordering that is normally not possible with default sort handlers.
By sorting by expressions you can do things like, showing NULL items last when sorting by a numeric field, or creating a custom sort order putting some content types on top. The possibilities are endless.
You may use whatever is currently available in the query. For that reason, you should always enable the "Show the SQL query" on the Views setting page to help you find the proper field aliases. Adding a field or the like to the view doesn't necessarily alter the SQL Query. You may find it useful to add what you need in the proper sort order, use it inside the expression, then rearrange your expression where you need it.