CMS: Adding and Setting Up a Dataset

13 min read
A dataset serves as the bridge that connects elements on your page to the content in your CMS (Content Management System) collection. Use datasets to create a two-way connection for displaying collection content, storing user input values in your collection, or both. You can control which items appear, the order in which they display, and how many can load at a time from your dataset settings. 

This article walks you through adding and setting up a dataset first, then connecting page elements to it. Alternatively, you can create the dataset during the process of connecting supported elements to your CMS collection
Before you begin:
Make sure to add the CMS to your site if you haven't already. 

Step 1 | Add a dataset

In your editor, go to the page in which you want to connect elements to a CMS collection and add a dataset. If you want to use the dataset to collect visitor submissions, choose the form dataset. 
Wix Editor
Studio Editor
  1. Go to your editor and navigate to the relevant page.
  2. Click CMS  on the left. 
  3. Click Add Content Elements.
  4. Click the dataset type you want to add: 
    • Dataset: Add a blank dataset to connect page elements so they can display content from your collection.  
    • Form dataset: Add a dataset configured to accept form submissions from site visitors. 
A screenshot of adding a dataset in your Editor.

Step 2 | Connect the dataset to a collection

Choose which collection you want to connect your dataset to. You will use this collection to either display content on your page elements, capture visitor inputs, or both. 
Wix Editor
Studio Editor
  1. Click the Choose a collection drop-down and select the collection you want to connect. 
    Tip: Select Create Collection to create a new collection.
  2. (Optional) Click the Dataset name field to edit the name of the dataset.
  3. Click Create
A screenshot of creating a dataset in the Wix Editor.

Step 3 | Edit the dataset settings

Adjust your dataset settings to fine-tune how the connected collection content interacts with the connected page elements. Start by setting permissions to control who can view or modify content on your live site. Choose the dataset mode to determine if it can read, write, or do both. Edit the maximum items per load and configure performance settings for optimal loading. You can also add filters and sorts to manage which items display, and in what order.
Wix Editor
Studio Editor
  1. (Optional) Click the permission type next to Permissions to determine who can view, add, update, or delete collection content on your live site.
  2. (Optional) Click the Dataset name field if you need to edit the name of the dataset. 
  3. (Velo only) Click the Dataset ID field to edit the ID used to identify the dataset in your page's code. 
  4. Click the Dataset mode drop-down and select the relevant option:  
    • Read: Connected elements can read and display content from your collection. The elements cannot modify the collection content. 
    • Write: Connected elements cannot display content from the collection. Input elements can add content to the collection but cannot modify the collection's existing content.  
    • Read & Write: Connected elements can display content from your collection. Input elements can add or edit content in your collection. 
  5. Edit the Items per load field to set the maximum number of items that can load at a time.  
Screenshot of the dataset settings.
  1. (Velo only) Select the relevant checkboxes under Performance:
    • Fetch after the page loads: The dataset's data is fetched only after the rest of the page has finished loading. This means the initial rendering of the page will not be blocked by this dataset, making the page load faster. We recommend this option when elements displaying the data are not initially visible. For example, if they require scrolling into view or opening a section.
    • Fetch pages using cursors: The dataset will load initial and subsequent data using sequential cursors. This makes data loading faster at the expense of only allowing navigation between next and previous pages of data. Navigating between different pages with a pagination bar or 'Next/Previous page' dataset actions is not available with this option.
  2. (Optional) Click + Add Filter to add a dataset filter that includes or excludes certain items from displaying in the dataset's connected elements.
  3. (Optional) Click + Add new sort to add a dataset sort that controls the order in which the items display.
    Tip: Alternatively, you can display items in the same order as they appear in your collection view by enabling 'Mirror on Site'. If you've enabled 'Mirror on Site', you can add sorts to the dataset to override the order used in your collection.
Screenshot of adding a dataset sort.
  1. (Optional) Enable the Show on all pages toggle under Advanced Settings to use the dataset globally across all site pages. This allows you to connect elements in your header or footer to your CMS collection.
    Note: Adding many global datasets may slow your site's performance. 

Step 4 | Connect page elements to the dataset

Now it's time to connect the page elements to your dataset so they can read or write content. You'll see different connection options depending on the element you connect. If you're connecting an image or a button, you can choose click actions to determine what happens when visitors click them (e.g. 'Load More', 'Submit', 'Next item'). 
Wix Editor
Studio Editor
  1. In your editor, select the element you want to connect to the dataset.
  2. Click the Connect to CMS icon .
  3. Click the Choose a dataset drop-down and select the dataset you want to connect.
  4. Click the relevant drop-down menus under Connections and choose the collection fields or dataset actions you want to connect to each part of the element. The connection options vary depending on the type of element you connect
A screenshot of the dataset connection options for an image.
  1. Click Preview to test your CMS connections. 
  2. Click Publish if you are ready to make the changes go live. 

FAQs

Click a question below to learn more about setting up datasets.

Did this help?

|