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.
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:
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 email@example.com