Join the Webstudio community

Updated 4 months ago

Is there a way to bind on click events to a collection

At a glance

The community member has created a set of buttons that call a fetchData function with different arguments. They are trying to create a filter system, and the comments suggest that they should consider using a headless CMS or watching a tutorial on filtering data. The community members discuss potential solutions, including using the last part of the URL as the filter, but there is no explicitly marked answer.

Useful resources
<button onclick="fetchData('casino_features')">Casino Features</button>
<button onclick="fetchData('payment_methods')">Payment Methods</button>
<button onclick="fetchData('licenses')">Licenses</button>
<button onclick="fetchData('languages')">Languages</button>
<button onclick="fetchData('providers')">Providers</button>

i have a test called fetchData which takes these arguments. the buttons are created through a collection and the collection contains the variable title. is there a way to bind this. or will i need to self host and do some magic outside of webstudio.
O
A
8 comments
Lets go back for a second and define what you want to achieve
clicking on button to filter data fetched from a resource?
so im trying to create a filter system
Attachment
image.png
ok will check this out ty πŸ˜„
i think my issue will be how my cms works but will check this first
ok so I need to stay with my current cms which has limited filtering atm. To do what i need I just need to have it so i can run a different request on each dynamic page and then the last part of the url will be the filter.
Attachment
image.png
Add a reply
Sign up and join the conversation on Discord