Skip to content

Design repeatable lists and galleries

Use a list field for content the owner can add, remove and reorder: services, team members, testimonials or gallery entries. Each item has the same child-field schema. Use a fixed group when there should be exactly one object, such as business details.

In the Studio definition, services is a list with title, summary, image and href in each item. maxItems: 6 limits its size, and minItems: 1 requires at least one item when publishing.

The owner can add an item, edit its fields, remove it or change its position. New items start with empty child values: nested lists are empty, booleans are false, and simple fields are empty strings. Do not expect a newly added item to clone the first default card.

Add this entry to editor.json.collections:

Collection inside editor.json
{
"path": "services",
"view": "gallery",
"labelField": "title",
"descriptionField": "summary",
"imageField": "image"
}
Setting How to read it
path: "services" Configure the list at this content path.
view: "gallery" Present items with the gallery-style collection view.
labelField: "title" Use the item’s service name as its summary label.
descriptionField: "summary" Show its short description in the summary.
imageField: "image" Resolve the item’s selected asset for its thumbnail.

The paths for label, description and image are relative to a single item. Use title, not services.title, services.0.title or services.*.title.

For nested groups, a relative path such as details.title can point to a text field inside the item. These summary paths may cross groups, not another list. A label must reference text; a description must reference text or link; an image must reference asset.

Use view: "list" for entries recognized mainly by text, such as navigation links. Use view: "gallery" when images help recognition. This changes the dashboard collection view, not the public website’s CSS layout.

If collection settings are omitted, the editor infers summaries from available fields and chooses a view automatically. Explicit configuration makes the intended result easier to understand and maintain.

The collection’s path may pass through groups to reach a list, such as homepage.services. It must identify a list in the schema. A path through a repeated list, a wildcard, or a concrete item index is not a collection configuration path.

Place the top-level group or list in a section using its top-level ID. You cannot move one nested item field into a separate top-level section.

Keep the most recognizable field first in each item, choose a realistic item cap, and give image fields clear labels. Check empty, one-item and maximum-size cases. Test add/remove/reorder and make sure the public component preserves the owner’s order.

A showServices checkbox and a services collection are independent fields. Put them together in one editor section for clarity, then implement visibility in your Astro component. Neither the checkbox nor minItems provides conditional schema rules.