| Drupal

drupal sort views alphabeticallyAlphabetical sorting is one of the most common ways people want to sort content in Views.

You may want to sort many types of content from A to Z, from staff members to business listings.

Here's how to add alphabetical sorting to your Drupal views.

Option #1. Create a new view

  • Go to Structure > Views > Add new view.
  • Enter any views settings you want, except for "sorted by". You should choose "Title" for this setting.
  • Click "Continue and Edit".
  • Scroll down to your preview at the bottom of the view. You'll see that your view is sorted alphabetically, but from Z to A.

Now we'll fix the Z to A sorting.

  • Look under "Sort Criteria" and click on "Content: Title (desc).
  • Change "Sort descending" to "Sort ascending":
  • Check the Preview and you'll see that your view is now sorted alphabetically:

Option #2: Changing an existing view

If you want to add alphabetically sorting to an existing view, the process is very similar:

  • Click "Add" next to "Sort Criteria".
  • Search for "Content: Title" or another field that you want use for alphabetical sorting.
  • Choose "Sort ascending" to sort your view from A to Z.

About the author

Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.