Goal: I would like for viewers to be able to press a sort button on my gallery page. The gallery comes with built in “Heart” (like) feature with a counter on each picture. I would love for viewers to be able to sort by highest “liked/heart” picture.
At the moment I was able to add a pagination bar to be able to show 20 images per “page” but I have not been able to figure out how to add a sort for the hearts.
If you’re using a dataset or a query to populate the gallery, you can sort them before populating the gallery, if you’re populating the gallery with a custom array, you can map the array to its titles and then sort it, after that, you need to use a for loop to get the index of each item of the mapped array and then populate the gallery.
Hope this was useful.
If you have further questions please open a new post with your question.