Provides a views filter that sorts node titles by a more natural manner by ignoring articles like "The" and "A."

Normal sort:

  • A Chorus Line
  • All American
  • Fiddler on the Roof
  • Oklahoma!
  • The King And I

Natural sort:

  • All American
  • A Chorus Line
  • Fiddler on the Roof
  • The King And I
  • Oklahoma!

Natural Sort also supports Numbers.

Normal Sort:

  • 1 apple
  • 10 apples
  • 2 apples

Natural Sort:

  • 1 apple
  • 2 apples
  • 10 apples

This is done using a prebuilt, indexed table so it should perform well.

If you want to learn more, checkout the documentation to find out how to configure and install the module.

Features:

There is now the ability to remove words and symbols so that they are not included in sorting. By default this includes the words, "A", "An", and "The" from the beginning of titles, "and", "or", and "of" from other parts of the title, and the symbols # " ' ( and ).

It also sports the following features.

  • Natural sort support for user specified limited text fields.
  • Developer abilities to create new Natural Sort modules.
  • Developer abilities to create new transformation methods for help sorting data naturally.
  • Partial Upgrade path for current index data.
  • Sort actually uses it's own sort handler instead of fake fields.
  • Natural Sort on text properties of any entity
  • Built in sorting naturally by numbers
  • Built in sorting naturally by days of the week when enabled.

Note: When working with fields there is the need to enable fields for indexing. At the point the setting is enabled, the field is indexed and will be ready for use in a view. Follow the following steps to allow natural sorting on text fields:

  1. Enable Views Natural Sort
  2. Also Enable Views Natural Sort Text Field support (this will most likely go away in the future)
  3. Navigate to the fields edit page for the field that you wish to enable Natural Sorting on and check "Enable natural sorting." http://screencast.com/t/eDkW0c6AC This is needed so that we aren't indexing other text fields needlessly bloating the sorting table. In the future there may be a separate table for each field, I'll have to do some performance testing.
  4. When you do that, your fields "Should" be reindexed... at that time. You should be taken to a batch operations screen.
  5. Next you can go to the view you are editing and the option to sort the view naturally should be there. http://screencast.com/t/6XD7oeBtl

Drupal 8

There is now a D8 branch and alpha releases that allow you to use Views Natural Sort on D8. Please see the roadmap for D8.

Alphas are not going to be fully featured.

Betas will be fully featured but architecture changes will happen to take advantage of D8 features.

Automated tests will be built for D8.

Help Test!

Want to help test but don't want to try and install the module? Great! Head on over to SimplyTest.me and give it a go on a cleanly generated drupal install.

Recently, I've added Automated tests to 7.x-2.x, and 8.x-2.x, to help make sure that some of the features built remain functioning. Additionally, it helps me not need to go through and do manual UI testing. However, not everyone writes tests with their patches, and there are areas of the module that don't have tests written for them yet. Feel free to contribute here... If anything with an issue specifying a test that is needed.

Note: Be sure to read the New Documentation. Please report all issues and tag them with the current alpha release version if you find issues. See all known issues in the issue queue.

Project Information

Downloads