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
- Navigate to the CMS section in the editor sidebar
- Click Add Collection
- Name your collection (e.g., “Blog Posts”, “Team Members”, “Products”)
Built-in Fields
Every collection includes these built-in fields:
| Field | Description |
|---|---|
id | Unique identifier for each item |
name | Display name for the item |
slug | URL-friendly identifier; often used for dynamic page URLs |
created_at | Timestamp when the item was created |
updated_at | Timestamp 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
| Type | Description |
|---|---|
| text | Single-line text |
| rich_text | Formatted content with the rich text editor; supports bold, italic, links, lists, headings, and embedded components |
| number | Numeric values |
| boolean | True/false toggle |
| date | Date and time values (stored with timezone) |
| date_only | Date without time (e.g., birthdays, deadlines) |
| color | Color picker value |
Contact
| Type | Description |
|---|---|
| Email address | |
| phone | Phone number |
| link | URL or link |
Assets
| Type | Description |
|---|---|
| image | Image upload; supports multiple files when data.multiple: true |
| audio | Audio file upload; supports multiple files when data.multiple: true |
| video | Video file upload; supports multiple files when data.multiple: true |
| document | Document upload; supports multiple files when data.multiple: true |
Relations
| Type | Description |
|---|---|
| reference | Link to a single item in another collection |
| multi_reference | Link 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:
| Property | Description |
|---|---|
| Name | Display label shown in the editor |
| Slug | API identifier used when binding data or querying; must be unique within the collection |
| Required | When enabled, the field must have a value before saving |
| Help text | Optional description shown to content editors |
Managing Fields
Adding Fields
- Open the collection settings
- Go to the Fields section
- Click Add Field
- 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:
- Open the collection
- Click Import
- Upload your CSV file
- Map CSV columns to collection fields — Ycode auto-matches headers to field names or slugs (case-insensitive). Unmatched columns default to “Skip”
- 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.