top of page

Connecting CMS collection content to your site

CMS: Adding and Setting Up a Dataset

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 when connecting supported elements to your 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 dataset to connect page elements so they can display content from your collection. By default, this dataset is set to 'Read' mode.
    Form dataset: Add a dataset configured to accept form submissions from site visitors. By default, this dataset is set to 'Write' mode.

A screenshot of adding a dataset in the Wix 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 page elements you'll connect to the dataset. 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 the collection's content.

  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. (Coding 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.
    Fetch only connected fields: The dataset loads only the fields that are connected to the elements on the page. Disconnected fields and collection data accessed by code are excluded, which can significantly enhance performance by reducing unnecessary data fetching. This setting is particularly useful for optimizing load times, especially on pages with complex datasets.

  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.

How do I control how much content appears in repeaters and galleries?

For repeaters and galleries linked to datasets, the Items per load dataset field controls how much content can load at a time. This is also the maximum items that load when visitors click 'Load More' buttons, 'Next/Previous Page' buttons, and pagination bars (Wix Editor only).

Learn more about:

Can my dataset display content from different collections?

Yes. You can use reference fields to associate an item in one collection with an item in another collection. For example, in a "Songs" collection you could reference a field from another "Artists" collection to display both the artist and the song title in the dataset's connected element.

Learn more about using reference fields in your collections.

Can I connect text elements to show the total items in a collection?

Yes. You can connect text elements to the dataset item count to display the total number of items in the collection.

If you filter out items in the dataset settings, these items don't count towards the total. For example, if your collection has 10 items and the dataset filter excludes 2 items, the dataset item count is 8 since 10-2=8.

The same concept applies if you have input elements that allow site visitors to filter the content they see. When visitors use the filters to exclude items, the item count changes to reflect the new total items retrieved by the dataset.

Can I control the order in which the items display on my live site from my collection?

Yes. You can enable the "Mirror on Site" feature to apply the order of your collection view to connected site elements. Keep in mind that any sorts added to datasets override the order set in the mirrored collection view.

How do I link buttons or images to an item's dynamic item page?

Connect buttons or images to the dataset to link them to an item's dedicated dynamic item page. Click the relevant button or image and select the Connect to CMS icon . Then connect the element to the relevant dataset and select the relevant dynamic item page from the Click action connects to drop-down (use the Link connects to drop-down for images).

Learn more about linking buttons to dynamic pages.

How do I create a 'Load More' button?

'Load More' buttons allow visitors to click to load more items in repeaters or galleries connected to datasets. The total maximum items that can load at a time is determined by the Items per load field in the dataset settings. You can set this field to show up to 1,000 items at a time.

To create a 'Load More' button, add a button or image, connect it to the dataset and set the element's click action to Load more.

Learn how to add a 'Load More' button to a:

Note: If you connect a pro gallery to your collection's 'Media Gallery' field type, you can use the gallery's built-in 'Load More' button to restrict the number of images or videos displayed on the page. For directions, see the question below titled: Why doesn't my pro gallery's 'Load More' button respond to the dataset settings?

Why doesn't my pro gallery's 'Load More' button respond to the dataset settings?

The pro gallery has a built-in 'Load More' button that can restrict the number of media items displayed in the gallery.

If you enable this 'Load More' button in the gallery's layout settings, it uses these settings to determine when to appear and how many more images load. With the gallery's built-in 'Load More' button, the dataset's Items per load setting determines the aggregate total maximum items that can load in the gallery. However, it no longer determines how many items initially load in the gallery or how many additional items load when visitors click this 'Load More' button.
Screenshot of enabling the Pro Gallery's built-in Load More button settings.

Consider the type of collection field your gallery connects to when deciding which 'Load More' button to use:

  • Image field type: If your gallery connects to an image field used to display only 1 image per collection item, create a 'Load More' button that connects to the dataset. View the steps in the FAQ above to learn how.

  • Media gallery field type: If your gallery connects to a media gallery field used to display several images per collection item, use the gallery's built-in 'Load More' button. Learn how to enable the 'Load More' button in the pro gallery's custom layout settings.

Can I add 'Next' and 'Previous' buttons for visitors to cycle through items?

Yes, you can create navigational buttons or images visitors can click to browse other collection items.

To create 'Next' and 'Previous' buttons:

  1. Add buttons or images and connect them to the same dataset that connects to the page elements displaying your collection items.

  2. In the dataset settings, connect the dataset action according to the type of page:Dynamic list pages: Set the Click action connects to field to Next page or Previous page. When visitors click the buttons, the next or previous 'page' of items loads in the connected repeater or gallery. The Items per load field determines the maximum items per 'page'.
    Dynamic item pages: Set the Click action connects to field to Next dynamic page or Previous dynamic page. When visitors click the buttons, they navigate to the next or previous item's version of the page at the item's dedicated dynamic URL.
    Static pages: Set the dataset's Click action connects to field to Next item or Previous item. When visitors click the buttons, the dataset's connected elements change to reflect the next or previous item retrieved by the dataset.

Learn more about the various click actions you can set for buttons and images.

Can I add a pagination bar to repeaters and galleries?

Yes, you can add a pagination bar to give visitors a way to navigate to different 'pages' of items on your dynamic list page. Add a pagination bar and connect it to the same dataset that your repeater or gallery connects to. Then adjust the Items per load field to set the maximum items that appear in each 'page' of items.

lord of the wix_edited.jpg

Need A Professional Website?

Contact Us Today!

lord_of_the_wix

© 2025 BY LORD OF THE WIX

©
bottom of page