MVC Blog: Sorting


Garry West
09/06/2024

So our blog is shaping up nicely, but our index page is not sorted in any order. It would be nice to be able to sort by Title or Date, either ascending or descending.

This is easily accomplished by adding links to the top of \views\blogpost\index:

And some logic to the index action in BlogPostController:

blog , mvc