CMS: Adding and Setting Up a Single Item Collection
3 min read
A single item collection contains one block of content made up of standard fields that you add to. The content you add to these fields can appear on one or more static pages of your website. To display the content, you connect elements on your page to the fields in your collection.
This type of collection does not have a table layout in the CMS. It is best suited for non-repeatable content, such as an about page or a single element, like a picture or a text box.
Learn more about single item collections.
Step 1 | Create a single item collection
When you create a collection, you either select a collection with a single item or a collection with multiple items.
To create a single item collection:
- Go to CMS in your site's dashboard. Alternatively, you can click CMS in your Editor.
- Click Create Collection.
- Enter a name for your collection.
- Click the drop-down and select A single item.
- Click Create.
- Click + Add Field to start adding fields to your collection.
- Define the following parameters:
- Field type: Select the type of content you want to add.
- Field name: Enter a name for this field.
- Field ID: This is used in your code and can’t be changed later.
- (Optional) Enter info in the Help text (optional) field. This text appears in the collection only. It won’t show up anywhere on your site.
- Click Save.
- Continue to add as many fields as you need for this collection.
Step 2 | Connect elements to your single item collection
Connect (or data bind) page elements to the fields in your single item collection by using a dataset. This is the same method you use to connect to a collection with multiple items.
New datasets experience:
In Wix Studio, we've moved datasets to the Inspector panel on the right to make them easier for you to use. Learn more about the new datasets experience in Wix Studio.
To connect elements to your single item collection:
- Add a dataset to your page.
- Select the dataset and click Settings.
- Click the Connect a collection drop-down and select your single item collection.
- Click the page element you want to connect.
- Click the Connect To CMS icon .
- Click the Connect a dataset drop-down and select the relevant dataset.
- Click the Connection Options drop-down and select the required field(s).
Did this help?
|