Sorting blog articles through a filter dropdown

Hi,

We have a blog listing page displaying all articles related to a certain tag. Page url looks like this: /blog/tag/{tag-name}

One feature of this page is to filter posts by Most Popular and Latest articles through a dropdown box. My question is how do we achieve this that when the option is selected, the articles will be sorted in an “ajax” kind of way and without having to reload the page. Is this possible?

Thank you!

Hi @jjimeno ,

Thank you for sharing your question in the Community.

@Stephanie-OG and @DanielSanchez , could you please share your suggestion for @jjimeno ?

Hey @jjimeno

There are quite a few ways to implement this. See here

This article provides the pieces to implement sorting on the ui.

I’d imagine you could add 2 data attributes and use those to sort rather than innerHTML like the article shows.

Hope this gets you going in the right direction.