| 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".
media_1417526439934.png
  • 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.
media_1417526486798.png

Now we'll fix the Z to A sorting.

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

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".
media_1417526791376.png
  • Search for "Content: Title" or another field that you want use for alphabetical sorting.
media_1417526826052.png
  • Choose "Sort ascending" to sort your view from A to Z.
media_1417526853388.png

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.