Collections and fields

A collection defines one type of content and the fields that each of its items has. Example: the collection Blog has the fields Title, Excerpt, Cover image, Published on and Content.

Create a collection

  1. Open the Content panel.
  2. In Collections, click + (New collection).
  3. In Name, type a name. Example: Blog.
  4. Optional: change Slug. The App makes the slug from the name. Example: blog.
  5. Optional: select an Icon.
  6. Add the fields. See Add a field.
  7. Click Save.

A new collection has three fields: Title, URL Slug and Content. URL Slug does not show in Edit collection. Each item shows it in the item editor.

The App also makes a content template for the collection. See Content on pages.

Note: Edit collection does not save automatically. Click Save to keep your changes.

Edit a collection

The Edit collection dialog for Blog, with the icon, name, slug, parent folder, address preview and the list of fields.
Edit collection sets the name and address of a collection and its fields.
  1. In Collections, move the pointer over the collection.
  2. Click the gear icon (Edit collection).
  3. Make your changes.
  4. Click Save.
SettingWhat it does
IconThe icon in the list of collections. Type in Search icons to find one.
NameThe name of the collection in the App.
SlugThe first part of the address of each item. Example: /blog/.
Parent folderA page folder that the items go under. Example: /news/blog/. Select None for no folder, or New folder to make one.
PreviewThe address that each item gets on the live site.
FieldsThe fields of each item.
SkillRules that the agent obeys when it writes items in this collection.
Danger zoneDelete collection.

Change the address of a collection

When you change Slug or Parent folder, the App moves the collection when you click Save. The content template and the links to the items move with it.

If the items are on the live site, the App asks: Do you want to create a forward for this collection?

  • Select Yes to send visitors from the old addresses to the new addresses.
  • Select No to make no forward.

See Redirects.

Add a field

  1. In Fields, click Add field.
  2. Select a type. See Field types.
  3. In Label, type the name of the field. Example: Excerpt.
  4. Optional: in Description, type what the field is for.
  5. Set the field settings. See Field settings.
  6. Click Save field.
  7. Click Save.

The description shows under the label in the item editor. The agent reads it too.

Note: You cannot change the type of a field after you make it. This prevents the App from reading old values in a new way.

Change, move or remove a field

ActionHow
Change a fieldClick the pencil icon (Edit field) on the field.
Move a fieldDrag the grip on the left of the field.
Move a field into a groupDrag the field onto the group.
Remove a fieldClick the trash icon (Remove field).

Title and URL Slug are always there. You cannot remove them.

Note: Save is not available while a field is open. Click Save field or Cancel first.

Field types

The Edit collection dialog with the Add field list open: Text, Content, Toggle, Number, Date, Date & time, Dropdown, Multi-select, Link and more.
Add field opens the list of field types.
TypeUse it forIn the item editor
TitleThe name of each item. Each collection has one.A text box
TextA name, a subtitle or a paragraphA text box, one line or many
ContentThe body, built from blocks. A collection can have more than one.The block editor
ToggleYes or noA switch
NumberA price, a countA number box
DateA dayA date picker
Date & timeA day and a timeA date and time picker
DropdownOne option from a list that you makeA menu
Multi-selectSome options from a list that you makeChips
LinkAn address. Set the kind of link in Link type.A box for that kind of link
URL slugThe last part of the item address. Each collection has one.A text box after the address of the collection
ImageA cover or a photoA drop area and Alt text
Multi-imageA gallery, in your orderAdd images
ColorA color, or a color variable of your siteA color field
ReferenceOne item in a different collectionA search menu
Multi-referenceSome items in a different collection, in your orderA search menu with chips
ListSome short text valuesRows, and Add item
GroupFields that belong togetherA box with the fields of the group

Field settings

Open a field to see its settings under Field settings. The settings depend on the type.

SettingTypesWhat it does
RequiredAll, except GroupAn item with this field empty is Incomplete. An incomplete item does not go live.
DecorativeImageThe image is design only. The item editor asks for no alt text. Screen readers skip the image.
Link typeLinkThe kind of link: External URL, Internal page, Email address, Phone number, Page section or Download file.
ChoicesDropdown, Multi-selectThe options. Separate them with commas. Example: Light, Medium, Dark.
Number rulesNumberMin, Max, Whole numbers and Allow negative.
InputTextSingle line or Multiline.
Length limitsTextMin chars and Max chars. The item editor shows a counter for the maximum.
Conditional visibilityAll, except Title. The collection must have a Toggle, Dropdown or Number field.Show the field only when a different field has a given value.

Note: Title is always required.

Group fields

A group keeps related fields together. Example: a group "Event" with the fields Date, Place and Price.

  1. Click Add field, then select Group.
  2. Type a label, then click Save field.
  3. In the group, click Add field to group.
  4. Select a type for each field in the group.
  5. Click Save.

A group cannot hold a group, a Title field or a URL slug field.

Conditional visibility

A field can show only when a different field has a given value. Example: the field "Video address" shows only when the Toggle "Has video" is on.

  1. Open the field that you want to show or hide.
  2. In Conditional visibility, select the other field. Always means that the field always shows.
  3. Select the condition.
  4. Select or type the value, if the condition needs one.
  5. Click Save field.
  6. Click Save.

The other field must be a Toggle, a Dropdown or a Number field in the same collection or group.

Type of the other fieldConditions
Toggleis On, is Off
Dropdownis, is not, is set, is not set
Numberequals, does not equal, is less than, is at most, is greater than, is at least, is set, is not set

A required field that is hidden does not make the item Incomplete.

Connect collections with references

A Reference field links an item to one item in a different collection. A Multi-reference field links an item to some items, in the order you set.

Example: each blog post has one author.

  1. Make a collection "Authors".
  2. Open the collection "Blog".
  3. Click Add field, then select Reference.
  4. In Label, type Author.
  5. In Structure to link to, select "Authors".
  6. Click Save field, then click Save.
  7. In each blog post, select the author.

In the Designer, you can then show the name of the author on the blog card. See Content on pages.

When you change the slug of an item, every Reference and Multi-reference to that item changes with it.

For how to select items in a reference field, see The item editor.

Write rules for the agent

Skill holds the rules that the agent obeys when it writes items in this collection. Example: "Start with a one-line summary. Use H2 for sections."

  1. Open Edit collection.
  2. In Skill, type your rules.
  3. Click Save.

The App keeps the rules in the file SKILL.md in the collection folder. The rules are never on the live site. Each publish sends them to GitHub, so your team gets them. When you give the agent a rule in the chat, the agent can add it here.

Delete a collection

  1. Open Edit collection.
  2. In Danger zone, click Delete collection.
  3. Click Delete collection to confirm.

The collection, its items and its content template go to Removed in Site settings. You can restore them for 30 days.

Note: You cannot delete a collection while one of its items is set to Publish. Set each item to Draft or Archived first.