CMS: Connecting a Button to a Dataset
5 min read
In this article
- Connecting a button to a dataset
- FAQs
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.
Connecting a button to a dataset
Once you connect a button to a dataset, you can see all the available connection types in the Click action connects to drop-down. The dataset is what binds elements on your page to your CMS collection content.
Wix Editor
Studio Editor
- In your Editor, click the button you want to connect to the CMS.
- Click the Connect to CMS icon
.
- Click the Choose a dataset drop-down and select an existing dataset that connects to your collection. Alternatively, click Add a Dataset, then choose the collection you want to connect, give the dataset a name and click Create.
- 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. Learn more about the field types and their content limitations.
Tip: Select Add new field to add a new field in your collection and link to it.
![Screenshot of connecting a button to a dynamic item page.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2023/08/29/27c70f13-53ae-464a-86df-651d9076bfa4/36275c7f-7d1f-43d8-b08a-cd4b2db1e34c.png)
- (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.
![Screenshot of connecting the button label to a collection field.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2023/08/29/a50970ba-7291-4077-b23a-53fb2e04a234/0290ac87-b4a7-4b19-86f1-2df8ba0d4ac1.png)
- Click Preview to test your connections.
- Click Publish if you are ready to make the changes go live.
FAQs
Click below for answers to common questions about linking buttons in the CMS.
Can I create a dynamic link that visitors click to send emails?
Can I display dynamic text on my button?
What types of content limitations should I be aware of when connecting to different field types?