CMS: Adding and Setting Up a Switch Element

1 min read
Add a switch or toggle to allow people to turn something on or off. It is similar to a checkbox, however the action is usually instantaneous, such as showing or hiding specific results or enabling music or videos to play.

Step 1 | Adding and Setting up a Switch Element

  1. Click Addon the left side of the Editor.
  2. Click User Input.
  3. Click and drag the switch element of your choice. 
  4. Click Settings
  5. Enter a value for the switch. 
The value property of this switch is used in JavaScript code. 
  1. Select or deselect the Toggled on by default checkbox. 

Step 2 | Connecting Your Switch Element

  1. Click the switch on your site. 
  2. Click the Connect to Data  icon.
  3. Click Connect a dataset to choose a dataset from the drop-down list.
  4. Click Toggled state connects to to:
    • Choose an existing field in your collection. 
    • Click Add a new collection field to create a new field in your collection. 
      • Enter a field name. 
      • Select a field type. 
Make sure you have a submit button on your page so visitors can submit their selection.