CMS: Connecting a Button to a Dataset

5 min read
Connect a button element to a dataset to define what happens when the button is clicked. For example, you could link a button to the "Submit" click action, a dynamic item page, or a document stored in your collection. You can also connect the button label to a collection field to show dynamic text on your button. 
The list of available dataset actions varies depending on the dataset mode and whether you connect to a regular dataset or a dynamic page dataset. Learn more about all the available dataset click actions

To connect a button to a dataset:

Wix Editor
Editor X
Studio Editor
  1. In your Editor, click the button you want to connect to the CMS. 
  2. Click the Connect to CMS icon .
  3. Create a new dataset or connect an existing one: 
    • Create a new dataset: 
      1. Click Create Dataset. If you already have a dataset on your page, click the Choose a dataset drop-down and select Create a New Dataset.
      2. Click the Choose a collection drop-down and select the relevant collection. If you do not have a CMS collection yet, click Create Collection and create a new collection
      3. (Optional) Click the Dataset name field and enter a name for the dataset. 
      4. Click Create
    • Connect an existing dataset: 
      1. Click the Choose a dataset drop-down.
      2. Select the dataset you want to connect.  
  4. Click the Click action connects to drop-down and select the relevant option:
    • Dataset Actions: Choose the action you want the dataset to perform when the button is clicked.  
    • Dynamic Pages: Choose the dynamic page you want to link to. Then choose how the link opens: In the current window or As a new window.
    • Fields: Choose the collection field you want to connect to. You can connect to the following field types: Audio, Document, Image, URL, or Video.
      Tip: Select Add new field to add a new field in your collection and link to it. 
  1. (Optional) Display dynamic text in the button that changes based to the collection item it links to. Click the Label connects to drop-down and select the relevant collection field.
    Tip: Alternatively, you can use static text that doesn't change by going to the button settings.