Hi! I have a list of happy hours & daily specials in the nearby restaurants. I have a filter set up so you can filter by the day of the week (Monday, Tuesday, etc.). The issue is:
if the event is “daily”, then it doesn’t appear when a user selects a day of the week
some events happen within a range (ex, Monday-Thursday). If a user selects “Monday” from the filter, then that event will not appear
If I write down the days as Monday, Tuesday, Wednesday, Thursday (instead of Monday-Thursday), the filter still doesn’t read it
How can I fix this? I am using Finsweet’s filtering but I cant seem to get it to work with their dynamic or standard filters.
While the native CMS filtering options for date/time fields focus primarily on future/past events and date ranges, you can achieve day-of-week filtering through custom code solutions. One approach is to use JavaScript to filter your Collection List items after they load, checking the date field values against specific days of the week.
For daily or range-based events, you can structure your collection to include separate fields for start dates, end dates, and recurring patterns. This allows you to build more complex filtering logic using Collection List filters combined with custom code.
Hopefully this helps! If you still need assistance, please reply here so somebody from the community can help.
Your best approach with an FS List Filter setup is probably;
In the CMS;
Create a Weekday collection, populate with 7 Mon - Sun entries
On your Events collection, add a multiref to Weekday. Populate with the appropriate days of the week for each in that multiref field.
In your page;
Add a nested collection list to the Events collection, and bind it to the multiref field
Emit the days each event runs, e.g. Mon - Sun in text elements within that nested list
Setup your filter attributes on those text elements
You’ll now be able do either singular selection like radio buttons, where you can only pick one day of the week ( or All ), or multi-day, where you can select multiple days, and any events in any of those days will show
I will just add that you should pay attention to this note:
Both solutions are valid but both require have collection to be loaded. This is very inefficient as you have to load all necessary data for each item in collection means name of pub, location, date, happy hours … to be able filter these. if you have a few (>200) you can be be fine but when you start adding more and you will need to first load 500+ or 1000+ your clients will have slow response experience on first load → that is bad.
In real world you make request to server to get from server only data you need . WF doesn’t offer this approach yet directly in WF, but WF has Webflow-api that provides some functionality you need.
There is another but least useful option and it is use of 3d-party paid service as Make to achieve this. Anyway, there is more ways how to but… Too much hassle for simple fetch request.
Probably the easiest for you will be @memetican option and add “LOADING DATA” loader on firs load when loading tons of data to let clients know why they have to wait.