CMS (Formerly Content Manager): Adding and Setting Up a Dataset
11 min read
A dataset serves as the bridge connecting elements on your page to the content in your CMS collection. Use datasets to create a two-way connection for displaying collection content, storing user inputs, or both. You can control which items load, the order in which they load, and how many 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 eligible elements to your CMS collection.
Before you begin:
Make sure to add the CMS (Content Management System) 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 collection and add a dataset. If you want to use the dataset to collect visitor submissions, choose the form dataset.
- Go to your Editor.
- Go to the page in which you want to add a dataset.
- Click CMS on the left of the Editor.
- Click Add Content Elements.
- 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.
You can move the datasets in your Editor wherever is convenient to you as they do not appear on your live site.
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.
- Click the dataset in your Editor.
- Click Settings.
- Click the Connect a collection drop-down and select the collection you want to connect.
Tip: Select Create Collection to create and connect a new collection.
- (Optional) Click the Dataset name field to edit the name of the dataset.
Step 3 | Edit the dataset settings
Now that you've connected your dataset to a collection, you can fine-tune its settings. Choose a mode to control whether the collection can be edited or not and decide how many items can load at a time. You can add filters to exclude certain items from appearing and add sorting conditions to choose the order in which the items appear.
- In the dataset settings, click the Dataset mode drop-down and select an option:
- Read: Elements on your page can read and display content from your collection. Site visitors cannot modify the content in your collection.
- Write: Elements on your page cannot display content from the collection. Visitors can interact with user input elements and submit buttons to add content to your collection. However, visitors cannot edit existing collection content.
- Read & Write: Elements on your page can read and display content from your collection. Visitors can interact with user input elements and submit buttons to add or edit content in your collection.
- Edit the Maximum items displayed field to set the maximum items that can load at a time. This is also the maximum items that load when visitors click "Load More" buttons on repeaters and galleries or "Next/Previous Page" buttons on dynamic item pages.
- (Optional) Add a filter to include or exclude items from the dataset:
- Click + Add Filter.
- Click the Field drop-down and select the field you want to filter.
- Click the Condition drop-down and choose the condition to use in the filter.
- (If necessary) Select the Value source:
- Manual entry: Enter the value you want to filter by in the Value field.
- Another dataset: Select the dataset and field you want to filter by from the relevant drop-downs.
- User Input element: Select the User Input element you want to filter by in the User Input drop-down. Learn more about setting up input elements that site visitors can use to filter your collection content.
- Click Add Filter.
- (Optional) Add a sort condition to choose the order in which items display:
- Click + Add Sort.
- Click the Field drop-down and choose the field you want to sort.
- Click the Order drop-down and choose the order you want the content to appear in.
- Click Add Sort.
Learn more about:
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).
- In your Editor, select the element you want to connect to the dataset.
- Click the Connect to CMS icon .
- Click the Connect a dataset drop-down and select the dataset you want to connect.
- Connect the relevant elements and connection options to fields in your collections or dataset actions. The connection options vary depending on the type of element you connect.
See how it looks before you publish:
Click Preview in your Editor to test the connections before publishing them to your live site.
Click a question below to learn more about setting up datasets.
How do I control how much content appears in repeaters and galleries?
Can my dataset display content from different collections?
Can I connect text elements to show the total items in a collection?