reference field is how one CMS collection points at another. It keeps content normalized — author info lives in one place, blog posts link to it — and gives editors a searchable picker instead of free-text retyping.
This guide covers how references work, the picker UI, single vs array references, and how to render referenced data on the page.
How References Work
In the manifest, a reference field looks like:"author": "jane-doe" (assuming the authors collection has an entry at content/authors/jane-doe.json).
The CMS panel renders a searchable picker for the field. Users type the author’s name; matching entries surface; click to select.
When your component reads the blog entry, it can either:
- Use the slug directly (cheap, fine for most cases)
- Read the referenced entry’s full data (a small additional read at build/request time)
Setting Up a Reference
1. Make sure both collections exist
The target collection (the one being referenced) needs to exist in the manifest first. If you don’t have anauthors collection yet, add one:
2. Add the reference field to the source collection
In the source collection (the one that points), add a field withtype: "reference":
3. Pick a value in the CMS panel
Open any entry in the source collection. The reference field renders as a search box. Type to filter, click to pick.Single vs Array References
A single reference stores one slug:Customizing the Picker
The picker shows the target entry’s title or name field by default. You can override withdisplayField:
label field instead of title.
Rendering Referenced Data
Your code reads the source entry’s slug for the reference, then optionally fetches the target entry to render its data.Option A: Use just the slug
If you only need the slug (for a link), no extra read needed:Option B: Fetch the referenced entry
For richer rendering — name, avatar, bio — fetch the target entry too:Option C: Resolve at the helper level
For larger sites with many references, ask the AI to add apopulate option to the CMS helper:
Common Reference Patterns
Blog ↔ Author
A blog post has one author. The author has a profile page and many posts.Product → Category (single ref)
Each product belongs to one category. Categories have their own listing pages.Product → Tags (multi ref)
A product can be tagged with multiple categories. Usemultiple: true.
Post → Related Posts (self ref)
A blog post can reference other blog posts:Case Study → Featured Products
A case study mentions specific products. Use a multi-reference:Dangling References
If you delete an entry that’s referenced by others, the reference becomes dangling — the source still has a slug, but the target is gone. The CMS panel handles this gracefully:- Source entries continue to save
- The picker shows a warning chip (“Missing: jane-doe”) for the dangling reference
- Your code should treat a missing target as nullable (
if (!author) return null;)
Verifying References
A few quick checks after adding a reference field:Picker opens with results
Open an entry in the source collection. Click the reference field. The picker should list entries from the target collection.If the picker is empty, the target collection has no entries — add at least one.
Saving stores the slug
Pick a value, save, then open the file in the code editor. The frontmatter (or JSON value) should show
"author": "jane-doe" (the target slug).Troubleshooting
Picker says 'No matching entries'
Picker says 'No matching entries'
Either the target collection is empty, or the search term doesn’t match any entry’s display field. Clear the search to see the full list.
Manifest validation: 'reference points at missing collection'
Manifest validation: 'reference points at missing collection'
The
collection value on a reference field must match an existing collection’s id. Check spelling — author and authors are different.Reference shows a slug instead of the entry's name on the page
Reference shows a slug instead of the entry's name on the page
Your component is rendering the slug directly. Either resolve the reference (Option B above) or use a populate helper.
Saved value is the wrong format
Saved value is the wrong format
Single references store a string slug; multi-references store an array of slugs. If your downstream code expects one format and gets another, double-check
multiple: true is set or unset correctly.The picker shows the wrong field
The picker shows the wrong field
Set
displayField on the reference to the field you want shown — e.g. "displayField": "name" for an authors collection where the title field is name.What’s Next?
Field Types
See every field type, including reference details
Collections
Patterns for collections that commonly reference each other
Editing Content
The picker UI in context
AI Integration
Ask the AI to wire up reference resolution