How to Implement Dynamic Category Filters with a Pre-Selected ‘All’ Option Using Finsweet CMS in Webflow

Axiabits
8 min read4 days ago

--

Introduction

If you’re looking to enhance your Webflow project with advanced filtering functionality, using Finsweets CMS Filter is a great solution. One of the key features is the ability to create dynamic category filters with a pre-selected ‘All’ option, offering users an easy way to filter and view content without reloading the page.

CMS Filter All Button Styling
CMS Filter All Button Styling

This blog will guide you through the process of setting up dynamic category filters using Finsweet CMS in Webflow, with a focus on styling the filters and ensuring the ‘All’ option is pre-selected upon page load.

Why Use Dynamic Category Filters?

Dynamic Category Filters
Dynamic Category Filters

Dynamic filters allow visitors to sort through content quickly, without having to reload the page, thus providing a seamless user experience. This feature is especially useful for eCommerce websites, blogs, or any platform with content organized into categories. Adding a pre-selected ‘All’ button ensures that users start with a broad view of all available content, which they can narrow down using your custom filters.

Implementing dynamic category filters in Webflow is a powerful way to enhance user experience. For other advanced Webflow features, such as creating a CMS modal in Webflow to provide users with more dynamic content presentation, you can explore additional options.

Step-by-Step Setup for Dynamic Filters in Webflow

Secure your unique domain today with Hostinger and kickstart your online presence! To implement dynamic filters in your Webflow project using Finsweet’s CMS Filter, follow these steps:

Webflow Project Setup

Before diving into the technical setup, it’s essential to have a properly structured Webflow project. Here’s a sample setup:

CMS Collection
CMS Collection
  • You should have a collection list that displays content, such as game levels, blog categories, or product types.
CMS Collection Example
CMS Collection Example
  • Each collection item can be linked to a theme or category, which is referenced from another CMS collection. For example, each game level might be assigned a specific theme or category, such as “water,” “fire,” or “earth.”

In this example, we’ll create dynamic filters for game levels, allowing users to filter by theme. The themes will be CMS-driven, but we will add a filter manually for the ‘All’ option.

Filtering CMS collections in Webflow not only enhances site navigation, but also allows users to find relevant content quickly. To dive deeper into this, you can explore our detailed guide on how to filter a Webflow CMS collection, which covers everything you need to know about optimizing content filtering.

Integrating Finsweet CMS Filter

Integrating Finsweet CMS Filter
Integrating Finsweet CMS Filter

The key to making your filters dynamic is using Finsweet’s CMS Filter, which simplifies the filtering process. Here’s how to get started:

  1. Copy the Finsweet CMS Filter Snippet: Head over to the Finsweet CMS documentation and copy the CMS Filter Snippet. Add this script to the <head> section of your Webflow project’s page settings.
Finsweet Filter Attributes
Finsweet Filter Attributes
  1. Add Finsweet Filter Attributes: To make the filtering work, we need to add Finsweet’s required attributes to the elements in your Webflow project. Let’s break it down:
  • Add the List Attribute: This attribute should be added to the collection list that displays your filtered content. Select the collection list element in Webflow, go to the settings panel, and add the following custom attribute:
  • Name: fs-cmsfilter-element
  • Value: list
  • Create Filter Buttons: Next, you’ll need filter buttons. These buttons allow users to filter content based on categories. Create a form block and insert radio buttons for each category (theme). For a CMS-driven filter, add a collection list and bind it to your categories (themes collection). Inside the collection list, add radio buttons, and for each radio button, bind the text label to the theme name.
  • Attribute Name: fs-cmsfilter-element
  • Attribute Value: filters

2. Adding Filter Functionality: Now, let’s ensure that these radio buttons can filter your content. To do this, add the fs-cmsfilter-field attribute to both the radio buttons and the text labels in your CMS items. This will allow the filter to compare the selected theme with the content.

  • For the radio buttons, add the following custom attribute:
  • Name: fs-cmsfilter-field
  • Value: themes (or the field name you are filtering by)
  • For the text label inside the CMS item, add the same custom attribute:
  • Name: fs-cmsfilter-field
  • Value: themes

Attributes play a vital role in creating dynamic category filters, much like how CMS nest collection lists allow for more intricate content structuring in Webflow, making it easier to organize and present related data.

Adding the ‘All’ Button

Once you have the category filters set up, it’s time to add the ‘All’ button. This button will allow users to reset the filters and see all content again.

  1. Create a manual ‘All’ button: Since the CMS won’t generate the ‘All’ button, you will need to create it manually. Add a radio button outside of the CMS collection list and name it ‘All.’ You can position this button at the top of the filter group.
  2. Add the Same Attribute to the ‘All’ Button: To make the ‘All’ button work seamlessly with the other filters, add the same fs-cmsfilter-field attribute to it. This ensures the button behaves like the other radio buttons, filtering the collection list by the value ‘All.’
  • Name: fs-cmsfilter-field
  • Value: themes

3. Ensure the ‘All’ Button is in the Same Group: One important detail is to make sure that the ‘All’ button belongs to the same radio button group as the other category buttons. You can do this by setting the group name to be the same for all buttons, such as themes.

Pre-Select the ‘All’ Button on Page Load

To improve the user experience, set up the ‘All’ button to be pre-selected when the page loads. Here’s how to set that up:

  1. Select the ‘All’ Radio Button: In the Webflow Designer, click on the ‘All’ radio button.
  2. Add the ‘Checked’ Attribute: To make the ‘All’ button pre-selected, add the checked attribute to it. Adding the checked attribute to the ‘All’ button will ensure that it is selected when the page initially loads, giving users a view of all content by default.
  • Name: checked
  • Value: true

Styling the Filters

Now that the functionality is in place, it’s time to style the filters so they don’t look like standard radio buttons. You want them to look like custom filter buttons that match the design of your website.

  1. Hide the Default Radio Buttons: You can hide the default radio buttons by adding a custom class, such as hide, to the radio input elements.
  2. Apply Custom Styling: For the filter buttons, you can apply custom classes that give them a more polished look. For example, you could create buttons with custom backgrounds and hover effects. You can also add a combo class for the active state, so the selected filter button has a distinct style.
  • Class for Active State: fs-cmsfilter-active
  • Apply your desired styles (e.g., background color, font weight, etc.) for this active state class.

3. Dynamic Colors: If you want to add an extra layer of customization, you can dynamically style each filter button based on the theme’s color. This can be done by applying styles to the CMS items in the collection list, making the filters more visually appealing.

Final Preview and Testing

Once you’ve added the functionality and styling, it’s time to test everything.

  1. Preview the Page: In Webflow preview mode, test the filtering by selecting different categories. Ensure that the filters work like radio buttons, allowing only one filter to be active at a time.
  2. Test the ‘All’ Button: Click the ‘All’ button to confirm that it resets the filter, showing all collection items.
  3. Check the Pre-Selected ‘All’ Button: Refresh the page and verify that the ‘Alldefault selects ‘ button when the page loads.

Axiabit Services

At Axiabits, we specialize in creating seamless, custom Webflow solutions that enhance your site’s functionality and user experience. Whether you’re looking to implement dynamic filters, improve your CMS setup, or integrate third-party tools like Finsweet, we can help you achieve your goals with ease.

Our team has extensive experience working with Webflow and advanced functionalities, ensuring that your site is optimized for both performance and aesthetics. Let us handle the technical details so you can focus on growing your business.

Need help with your Webflow project? Book now and let’s get started!

Conclusion

Using Finsweet CMS Filter in Webflow, you can easily implement dynamic category filters with a pre-selected ‘All’ option, providing a seamless user experience. With a few custom attributes and some CSS, you can make the filters not only functional but also visually appealing. Whether you’re working on an eCommerce site, a blog, or any CMS-driven project, these filters help users quickly find the content they’re looking for.

For large-scale content-driven sites, implementing a table of content with Finsweet attributes can greatly enhance user navigation, especially when combined with dynamic filtering features to streamline content access.

Disclaimer

This article features affiliate links, which indicates that if you click on any of the links and make a purchase, we may receive a small commission There’s no extra cost to you and it aids in supporting our blog, enabling us to keep delivering valuable content. We solely endorse products or services that we think will benefit our audience.

Frequently Asked Questions

What is a dynamic category filter in Webflow?

A dynamic category filter allows users to sort or filter items from a CMS collection based on predefined categories. With Finsweet’s CMS Filter, you can create dynamic, interactive filters that update the content displayed without reloading the page.

What does the ‘All’ option in filtering mean?

The ‘All’ option allows users to reset the filters and view all the items in a CMS collection, rather than being limited to specific categories. In this blog, the ‘All’ option is pre-selected when the page loads, ensuring all items are visible initially.

Why should I use Finsweet’s CMS Filter for Webflow?

Finsweet’s CMS Filter simplifies the process of adding advanced filtering to your Webflow project. It allows for easy filtering of dynamic CMS content, provides extensive customization options, and helps create a better user experience without heavy coding.

How do I add a pre-selected ‘All’ button in my filters?

In the blog, we cover the steps to create a radio button labeled ‘All,’ which is styled as a filter and is pre-selected when the page loads. This is done by adding a custom attribute to the ‘All’ button, defining it as checked by default.

How can Axiabits help me with my Webflow project?

At Axiabits, we specialize in Webflow integrations and customizations. If you need assistance in implementing dynamic category filters, advanced CMS features, or any other custom Webflow functionality, we can help you achieve your vision with ease. Need expert help? Book now and let’s get started!

--

--

Axiabits

We boost businesses with SEO, web dev, social media, ecommerce, and AI automation for remarkable growth and a strong online presence.