How can I add date filtering to my current list of filters in Webflow using Finsweet CMS Filtering?

TL;DR
  • Add and populate a Date field in your CMS, bind it to a visible and hidden element with fs-cmsfilter-field="date" using YYYY-MM-DD format.  
  • Place a date input with fs-cmsfilter-element="filter" and fs-cmsfilter-field="date" attributes.  
  • Load and configure Finsweet’s CMS Filter script with date as a target field; use custom JavaScript for date range filters if needed.

To add date filtering to your current filters using Finsweet's CMS Filter in Webflow, you need to set up your Collection’s date field properly and apply Finsweet’s filtering attributes to it.

1. Prepare the Date Field in Your CMS

  • Ensure your Webflow CMS Collection has a Date field (e.g., "Published Date," "Event Start Date").
  • If not, add a Date field to your Collection and populate it for each item.

2. Designate a Date Display Element in the Collection List

  • Within your Collection List, add a Text Element to display the date.
  • Bind the Text Element to your CMS Date field.
  • Set a custom attribute:  
  • Attribute name: fs-cmsfilter-field
  • Attribute value: the name you want to filter by (e.g., date)

  • Webflow formats this date for visual use. To filter effectively, you may need to add a custom format using Finsweet’s hidden field method:
  • Add a second element (e.g., a hidden <div>) containing the date in YYYY-MM-DD format.
  • Give this second element the correct fs-cmsfilter-field="date" attribute.
  • Set its display to none using Webflow's style panel.

3. Add a Date Filter UI Element

  • Place an input element (type: date) where users can select a date.
  • Add these two custom attributes using the Webflow Element Settings panel:
  • fs-cmsfilter-element="filter"
  • fs-cmsfilter-field="date"` (must exactly match the field used in the CMS items)

4. Load Finsweet's CMS Filter Script

  • Go to Page Settings › Custom Code › Before </body> tag and add Finsweet's filtering script:
  • Use Finsweet’s prebuilt script from their Official CMS Filter Docs.
  • Modify the script to include the date field inside the filter configuration.

Example initialization (do not paste raw code, follow Finsweet’s CDN integration and match filter target fields accordingly).

5. Consider Filter Logic (Optional)

  • CMS Filter doesn’t natively support range comparisons, so filtering exact dates works out-of-the-box.
  • For date ranges (e.g., “After today,” “Between two dates”), use custom JavaScript handlers after Finsweet initializes.
  • You can leverage the fs-cmsfilter-update event to write custom filtering logic based on input dates.

Summary

To add date filtering with Finsweet CMS Filter in Webflow, set your CMS date field properly, bind a hidden filterable field with consistent formatting, add a date input filter UI with Finsweet attributes, and include the Finsweet script. For advanced ranges, you will need custom script logic.

Rate this answer

Other Webflow Questions