The Switch field is a Collection field that is primarily used as a filtering tool. A switch is a field type which can have either of two values: Yes or No.
Switches are extremely useful when you're looking to filter elements based on something binary. An on or off or yes or no option.
Is this film black and white?
Is this company a non-profit?
Is this blog post featured?
This concept can be extended indefinitely. And when you add a filter? Simply select the Switch, and specify whether you're looking to display items that have the Switch on, or those that have the Switch off. The result of this filter is displaying only the results that fit this new Switch.
We can also create a Switch called "Show contact form" and go into our Collection Page? We can actually select an entire element inside — for our sign up div block — and set conditional visibility. We can go in and set a condition that shows this div block only if "Show contact form" is Switched on.
So. Switches. The word sounds odd the more you say it. The field is a powerful and straightforward way to work with dynamic content.
The Switch field is a Collection field that is primarily used as a filtering tool. A switch is a field type which can have either of two values: Yes or No. Collaborators can toggle a switch on or off to specify, for example, if a blog post “is featured.” The switch field can be used to filter Collection lists. You can even sort a list using switches. And one of the best ways to use a switch field is by setting conditional visibility on elements in Collection lists and Collection pages.
A switch field can be added to a new or existing Collection. In Collection settings, click on New Field and then choose the Switch field.
Whether you’re creating a new item in the CMS from the Designer or the Editor, you can set a switch on or off by simply toggling it to Yes or No.
If you want to create a Collection list that only displays items that have a specific switch set to Yes, like a Collection list of featured posts, you can create a filter that will do that:
The filter rules that you can use with the link field and values are:
Learn more about filtering collection lists.
Sometimes, you don’t want to exclude Collection items in a Collection list, but you would like to display specific items first, followed by less important items. So, instead of using a filter, you can specify a sort order using a switch field:
To make the most of Switches, you can use the conditional visibility feature to achieve a variety of designs. Here are a few examples:
If you have labels such as “Featured”, “On-sale”, “Out of stock”, etc. You can use conditional visibility to show them only on items that have a specific switch set to Yes.
You can create unique Collection pages that can each have totally different layouts based on the conditions set on sections of a Collection page.
For example, you can create a contact form section on the Collection page. Then, you can create a switch called "Show contact form" in your Collection. Now, if you set a conditional visibility rule on this section, the contact form will only show on Collection pages for Collection items with the contact form switch set to Yes.
To create a condition like this:
Something went wrong while submitting the form. Please contact support@webflow.com
Got a lesson suggestion? Let us know
Need more help? Want to report a bug? Contact support
Have feedback on the feature? Submit feature feedback