CMS: Understanding the Structure of Your Collection

3 min read
Wix's CMS (Content Management System) allows you to manage your site's content efficiently. It helps you create, store, and display content dynamically across your website. Understanding the structure of your CMS collections ensures that your content is organized, easily manageable, and dynamically displayed on your Wix site.

How collections work

In the CMS, collections are like databases where you store your content. Each collection has a specific structure that defines the fields and their types. When you add a dataset to your page, it includes only the fields defined in your collection. This setup ensures that your content is organized and can be dynamically displayed on your site.

Benefits of defined fields

Defined fields in your collections help in several ways:

  • Connecting page elements: Using datasets, you can easily connect page elements to fields in your collection. Only fields that are part of the defined structure can be linked, ensuring compatibility and functionality.
  • Creating dynamic URLs: When constructing URLs for dynamic pages, you can only use fields from the defined structure. This helps maintain consistency and avoid errors.

Undefined fields

Undefined fields are those that appear in your collection but are not part of the defined structure. This can happen if you restore a previous version of your site. In such cases, the old structure is restored, but the content remains unchanged, leading to undefined fields. These fields appear with a Warning icon , indicating they need to be defined.

To define an undefined field:

  1. Go to CMS in your site's dashboard. Alternatively, you can click CMS in your editor, then click Your Collections. 
  2. Click the relevant collection.
  3. Hover over the Warning icon that appears next to the undefined field's name. 
  4. Click Define field
  5. Click Change type next to the Field type.
  6. Select the appropriate field type for the data you are storing in the field. 
  7. Click Change Field Type
  8. Click Save.
Screenshot of setting the field type.
Note:
The Field ID is automatically defined when an undefined field is created and cannot be modified.

Velo by Wix and undefined fields

When using Velo by Wix, you can add content that doesn't belong to an existing field using the Data API. This creates a new field in your collection, but it remains undefined. To use these fields in datasets, you need to define them by selecting a field type. See the steps above for directions. 

Handling errors and restoring site history

Restoring your site from site history reverts its pages and their designs to a previous version. This applies to your dynamic pages and their layouts. However, the content and data structure (schema) in your CMS collections are not reverted when restoring your site. This can result in undefined fields. If needed, you can restore your collections to older versions using CMS backups.

Additionally, a 404 error may occur if your sandbox collection is not synced with the live content. Ensure you sync your sandbox content with your live content to avoid this issue.

Did this help?

|