Reference
Picks one or more entries from another collection, such as a post's author or a product's categories.
Add this field under fields in .pages.yml:
- name: author
type: reference
options:
collection: authorsA saved value in YAML or Markdown front matter might look like:
author: src/content/authors/sam-lee.mdBy default the entry's repository path is stored. Use value and label to store and show something else:
- name: authors
type: reference
options:
collection: authors
multiple: true
value: '{fields.name}'
label: '{fields.name} ({fields.role})'
search: fields.name,roleA saved value in YAML or Markdown front matter might look like:
authors: [Sam Lee, Ana Silva]If the site's schema uses Astro's reference(), it expects entry IDs, not repository paths. Choose a value template that produces the ID, such as a slug field the target entries share, and check a saved value against the site's schema.
Options
Template tokens
{name} is always the filename. To use a field called name, write {fields.name}. The same applies to search.
Changing value later doesn't update entries that already store the old format.