# Sorter Content Based on User Selection

**URL:** <https://forum.wixstudio.com/t/sorter-content-based-on-user-selection/32650>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [October 8, 2020, 6:32pm UTC](https://forum.wixstudio.com/t/sorter-content-based-on-user-selection/32650 "2020-10-08T18:32:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matiaslucero](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/matiaslucero/32/23974_2.png) [@matiaslucero](https://forum.wixstudio.com/u/matiaslucero)\
**Post date:** [October 8, 2020, 6:32pm UTC](https://forum.wixstudio.com/t/sorter-content-based-on-user-selection/32650/1 "2020-10-08T18:32:08Z")

</div>

[https://www.thepour.live/test](https://www.thepour.live/test)  
I need users to be able to sort the content like New/Old, Old/New and A/Z, Z/A…I managed to do filtering with dropdown and was wondering how to do the same but for sorting…I’m assuming we need some code?

_**I’m using dynamic pages and a repeater box - (Filtering works perfectly)**_

---

<div class="post-metadata">

**Author:** ![neffdesign](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/neffdesign/32/17554_2.png) [@neffdesign](https://forum.wixstudio.com/u/neffdesign)\
**Post date:** [October 8, 2020, 7:42pm UTC](https://forum.wixstudio.com/t/sorter-content-based-on-user-selection/32650/2 "2020-10-08T19:42:32Z")

</div>

If you just got the two options where you sort by you could use .sort().

> **[setSort - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-dataset/dataset/setsort)**
>
> Sets the dataset sort order. The setSort function sorts the items in the dataset. The WixDataSort object is created by calling the sort() function on wixData ...
