Learn how to add exposed sorts, which will let you sorts the view while filtering it.
We’ll cover the following:
- How to exposed the authored on sort.
- How to sort by the changed date.
Transcript
Trainer (00:00):
So far, we have been focused on exposed filters, but a sort can also be exposed, which will allow you to sort the view as well as filter the view. Let’s go ahead and expose the authored on sort so that you can sort this view by created date ascending and created date descending. Let’s edit the view and then scroll down to sort criteria. And we already have the authored on sort, so all we need to do is click on it and then check expose the sort to visitors. This is the same as exposing a filter to visitors as well. And then click on apply.
Trainer (00:41):
And then if we click on save, we’ll get a new dropdown, which is sort by. And the only option we have is authored on. And then we can go ahead and change the sort. Currently it is descending, but we can also change it to ascending.
Trainer (00:56):
Let’s take things one step further and let’s adding the ability to sort by the changed date. Currently, the or authored on date is when the article was created, but the changed date is when the article was last updated. Let’s edit the view, and then scroll down to sort criteria, and then click on add, and then type in changed and select the first changed from the content category. And then click on expose this sort to visitors, and let’s change the order from sort ascending to sort descending, and then click on apply, and then click on save. And now we can go ahead and sort the returned results.