You are here

README.txt in Views Sort Expression 7

Same filename and directory in other branches
  1. 8 README.txt
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 as a helper module to achieve custom ordering that are normally not
possible with the regular sort handlers or that you might need other contribs
for it.

By sorting by an expression 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 you have currently available on the query. For that
reason you should always enable the "Show the SQL query" on the Views's setting
page. Normally, adding a field or the like doesn't necessarily add to the SQL
query, so you may find useful adding whatever is you want to use and inside
the expression as a sort in the end, and put your expression where you need it.

File

README.txt
View source
  1. This is an advanced module as it basically requires you to know the SQL of the
  2. view and how to construct expression-based ORDER BYs.
  3. It aims as a helper module to achieve custom ordering that are normally not
  4. possible with the regular sort handlers or that you might need other contribs
  5. for it.
  6. By sorting by an expression you can do things like showing NULL items last when
  7. sorting by a numeric field, or creating a custom sort order putting some content
  8. types on top. The possibilities are endless.
  9. You may use whatever is you have currently available on the query. For that
  10. reason you should always enable the "Show the SQL query" on the Views's setting
  11. page. Normally, adding a field or the like doesn't necessarily add to the SQL
  12. query, so you may find useful adding whatever is you want to use and inside
  13. the expression as a sort in the end, and put your expression where you need it.