Skip to Content
DocsCMSCollections

Collections

Collections are structured data tables that define the schema for your dynamic content. You create a collection, add fields, and then add items that store values in those fields.

Creating a Collection

  1. Navigate to the CMS section in the editor sidebar
  2. Click Add Collection
  3. Name your collection (e.g., “Blog Posts”, “Team Members”, “Products”)

Built-in Fields

Every collection includes these built-in fields:

FieldDescription
idUnique identifier for each item
nameDisplay name for the item
slugURL-friendly identifier; often used for dynamic page URLs
created_atTimestamp when the item was created
updated_atTimestamp when the item was last updated

You use these fields without defining them. The slug field is commonly used as the source for dynamic page URLs.

Field Types

You add custom fields to define the structure of your content. Field types are grouped by category:

Basic

TypeDescription
textSingle-line text
rich_textFormatted content with the rich text editor; supports bold, italic, links, lists, headings, and embedded components
numberNumeric values
booleanTrue/false toggle
dateDate and time values (stored with timezone)
date_onlyDate without time (e.g., birthdays, deadlines)
colorColor picker value

Contact

TypeDescription
emailEmail address
phonePhone number
linkURL or link

Assets

TypeDescription
imageImage upload; supports multiple files when data.multiple: true
audioAudio file upload; supports multiple files when data.multiple: true
videoVideo file upload; supports multiple files when data.multiple: true
documentDocument upload; supports multiple files when data.multiple: true

Relations

TypeDescription
referenceLink to a single item in another collection
multi_referenceLink to multiple items in another collection

Inverse References

Inverse references let you display related items from the opposite direction of an existing reference field. Instead of following a reference forward (e.g., a Book’s author field pointing to an Author), inverse references look backward to find all items whose reference field points to the current item (e.g., showing all Books that reference the current Author).

You do not create a separate field for inverse references. They are configured as a data source on collection list layers. When a collection has reference fields pointing to another collection, those relationships automatically appear as inverse reference options in the source dropdown.

See Dynamic Pages for how to use inverse references in collection lists.

Field Properties

Each field has configurable properties:

PropertyDescription
NameDisplay label shown in the editor
SlugAPI identifier used when binding data or querying; must be unique within the collection
RequiredWhen enabled, the field must have a value before saving
Help textOptional description shown to content editors

Managing Fields

Adding Fields

  1. Open the collection settings
  2. Go to the Fields section
  3. Click Add Field
  4. Select the field type and configure name, slug, required, and help text

Reordering Fields

Drag fields in the Fields section to change their order. The order affects how fields appear when editing items.

Removing Fields

Remove a field from the collection settings. Removing a field does not delete existing values; it only removes the field from the schema. Historical data may remain in the database.

Data loss

Removing a field can make existing values inaccessible. Export or back up important data before removing fields.

CSV Import

You can import items from a CSV file:

  1. Open the collection
  2. Click Import
  3. Upload your CSV file
  4. Map CSV columns to collection fields — Ycode auto-matches headers to field names or slugs (case-insensitive). Unmatched columns default to “Skip”
  5. Review the mapping and start the import

The import processes rows in batches with per-row error reporting. If a cell value cannot be converted to the target field type, that value is skipped with a warning while the rest of the row imports normally.

Supported value conversions include plain text, numbers, dates, booleans, HTML to rich text, and image URLs (downloaded and added to the asset manager automatically).

Tip

Ensure your CSV headers match your field names or slugs for automatic mapping. Check the preview to verify column assignments before starting the import.

Last updated on