To create a dynamic drop-down filter for a CMS list in Webflow (like category or tag filters), you need to combine CMS Collections, custom elements, and optional JavaScript for interactivity.
1. Structure Your CMS Properly
- Create a Collection (e.g., "Projects") with a multi-reference or option field for categories, tags, or whatever you're filtering by.
- If using a multi-reference, ensure you’ve created a separate Collection for those categories or tags.
2. Add the Drop-Down Menu
- In your page layout, add a Dropdown component from the Add panel.
- Inside the Dropdown List, place a Collection List connected to your filter values (like categories or tags Collection).
- Style the list items as clickable links or buttons.
- Set each item to display the name of the filter (e.g., tag or category).
3. Build the Filterable CMS List
- Add a Collection List on the page bound to your primary content (e.g., Projects).
- Design your CMS items (cards, text, images, etc.) within that Collection List.
4. Set Filter Attributes (for JavaScript detection)
- On each CMS item, add a custom attribute that matches its filter value. Example:
- Select the parent div of a CMS item.
- In the Element Settings panel, add a custom attribute like:
- Name:
data-category - Value:
Current Category Name (use a text element with that dynamic value using CMS fields).
5. Add Custom JavaScript to Filter The Content
- Since Webflow’s native filtering isn’t dynamic with CMS out-of-the-box, use JavaScript to show/hide items:
- Add click listeners to your dropdown items.
- When clicked, the script compares the selected value against each CMS item's
data-category. - Show only matching items or all if the filter is set to “All”.
Note: Use Webflow’s custom code embed to place this script in the Before </body> tag section of your page’s settings.
6. Optional: Use Finsweet’s CMS Filter
- For a fully functional and no-code-friendly solution, implement Finsweet’s CMS Filter (https://www.finsweet.com/cms-filter).
- They provide:
- Step-by-step setup with an Attribute System (using
fs-cmsfilter) - Support for multi-filters, dropdowns, checkboxes, and URL filtering
- No custom code is required beyond attributes
Summary
To create a dynamic drop-down filter for a CMS list in Webflow, link the dropdown to your filter categories using CMS Lists, assign filter attributes to your content, and use JavaScript or Finsweet’s CMS Filter to show/hide items dynamically based on selection.