filter-checkbox
class and dynamic data-filter
values..categories
div).You're trying to enhance your custom dynamic filter in Webflow by enabling multi-select functionality—ideal for filtering CMS content by multiple categories, tags, etc.
To do this, you’ll need custom JavaScript/jQuery along with checkbox inputs tied to CMS filter logic.
input type="checkbox"
) and give it a class like filter-checkbox
.data-filter
attribute to the checkbox and bind it to the filter value (e.g., tag slug or category name).Example:
filter-checkbox
data-filter="business"
(Set dynamically using a text field in the CMS)Ensure these elements use consistent naming:
#cms-wrapper
cms-item
.tags
or .categories
.Example:
<div class="categories">business marketing</div>
Paste the following script just before the closing </body>
tag in Page Settings -> Before
tag:
Key behavior: It listens to checkbox changes, collects selected filters, and hides/shows CMS items accordingly.
<script> document.addEventListener("DOMContentLoaded", function () { const checkboxes = document.querySelectorAll(".filter-checkbox"); const cmsItems = document.querySelectorAll(".cms-item"); checkboxes.forEach((chk) => chk.addEventListener("change", function () { const selectedFilters = Array.from(checkboxes) .filter((box) => box.checked) .map((box) => box.getAttribute("data-filter").toLowerCase()); cmsItems.forEach((item) => { const categoryText = item.querySelector(".categories").innerText.toLowerCase(); const hasMatch = selectedFilters.length === 0 || selectedFilters.some((filter) => categoryText.includes(filter)); item.style.display = hasMatch ? "block" : "none"; }); }) ); });</script>
loading="lazy"
to images inside list items for better performance.While Webflow doesn’t have built-in multi-select filtering yet, this video tutorial shows how to implement a multi-select filter with checkboxes and CMS content using the method outlined above:
Recommended Video:
Webflow multi checkbox filter finsweet
or visit this Finsweet tutorialFinsweet's Attributes solution can also be used if you want to avoid custom code.
To enable multi-select filtering in Webflow:
data-filter
attributesThis makes your dynamic filters much more powerful and user-friendly.