How To Filter WIX Gallery Using Selection Tags.

@walterodibi Thank you for this! I followed the steps in the video exactly, and it’s working for me. I used Tags as the basis for my filtering, so I could assign more than one tag per image.

I’m looking to make this so that when a user clicks one of my “filters”, it shows only images for that “filter”/tag. Currently, if a user selects more than one “filter”/tag, it shows images for multiple “filters”/tags. I just want the user to be able to select one “filter” at a time, so it only displays one filter/tag at a time for the user.

Is this possible? I tried the code on the following link, but I couldn’t figure it out because it uses a lot of “repeater” code (take out the spaces after the domain and before the .com, my account is too new to post links) … https://www.wix . com/velo/forum/coding-with-velo/use-selection-tags-element-with-one-option-at-a-time-without-having-to-unclick-the-option

Here is my URL: https://www.alisonbryantevents . com/inventory

The code I used is:

import wixData from 'wix-data';   

$w.onReady(function () {       

$w('#selectionTags1').onChange(() => {      

const selectedTag = $w('#selectionTags1').value;           
let filter = wixData.filter();  
         
if (selectedTag.length > 0) {             
filter = filter.hasSome("newField", selectedTag);         
}           

$w('#dataset1').setFilter(filter);       

    }) 
});

Thank you so much for this…it’s been a huge help already!