How to Sort Drupal Views Alphabetically

drupal sort views alphabetically

Alphabetical 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.

Author

  • Steve Burge

    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.

0 0 votes
Article Rating
Subscribe
Notify of
11 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Anthony Pero
Anthony Pero
9 years ago

Any idea how to “page” alphabetically?

steve
steve
9 years ago
Reply to  Anthony Pero

Hi Anthony
Could you explain that question a bit more?

Anthony Pero
Anthony Pero
9 years ago
Reply to  steve

Views Paging. Sometimes I’d like the pager to page alphabetically, so the pager is A – B – C – D – E, etc, instead of 10 nodes on a page and 1 – 2 – 3 – 4 – 5, etc… This would be especially useful in a list of proper names, such as employees, schools, Sports Teams…

steve
steve
9 years ago
Reply to  Anthony Pero

Got it, thanks. Have you see the default “Glossary” view? That seems to do exactly what you describe.

Anthony Pero
Anthony Pero
9 years ago
Reply to  steve

I’ll check it out, thanks. Is that a pager setting, or a default view that needs to be enabled? Or something else?

steve
steve
9 years ago
Reply to  Anthony Pero

Yes, a default view to enable.

harfoyun
harfoyun
8 years ago

Thank you!

Артем Ильин
Артем Ильин
7 years ago

Any idea how to make search index(apache solr) view sortable by date field? There isn’t any default date sort criteria to use. So I must create one, but I can’t figure out how to make it work.

daniel-pickering
7 years ago

You could add a date field to the content type and then pull that into the view. Or use the date created date.

Артем Ильин
Артем Ильин
7 years ago

No. Unfortunately, It won’t help.

But I found the solution. To make search view sortable by date you have to add date field to search index.

Tammy P
Tammy P
5 years ago

The title sorting works great. However, we have a view that lists libraries and members (title was used for their names). The libraries are in order by when they were added to the site. This means any new member library we have ends up at the bottom of the list. Do you know of a way to get two different items in a view to sorted alphabetically?

11
0
Would love your thoughts, please comment.x
()
x