feat: add reference field link resolution for dynamic pages#81
Merged
liamwalder merged 4 commits intodevelopfrom Mar 24, 2026
Merged
feat: add reference field link resolution for dynamic pages#81liamwalder merged 4 commits intodevelopfrom
liamwalder merged 4 commits intodevelopfrom
Conversation
- Enrich page collection item data with dotted relationship keys so reference fields (e.g. Category>Name via Blog) render on canvas - Restrict "Current page item" link option to pages sharing the same collection, preventing broken cross-collection links
- Enrich page collection item data with dotted keys for canvas
- Restrict "Current page item" to pages sharing same collection
- Add "{FieldName} - Reference field" options for cross-collection links
- Resolve ref-page:* and ref-collection:* at render via item data
- Add richTextLink mark handling in renderTiptapToHtml (page-fetcher) with full LinkResolutionContext so page/field/ref-* links resolve - Scan rich text Tiptap content for page links in PageRenderer so specific item slugs and ref-* target collections are pre-fetched - Add hidePageContextOptions prop to suppress "Current page item" and reference field options when editing CMS item content directly - Refactor PageRenderer link scanning into module-level pure utilities (collectTiptapPageLinks, collectLayerPageLinks, extractCollectionItemSlugs) replacing two separate tree traversals with a single shared pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix CMS reference field values not rendering on the editor canvas, restrict "Current page item" links to matching collections, add reference field link resolution for dynamic page links, and fix rich text links not rendering correctly in preview and generated pages.
Changes
pageCollectionItemDatawith dotted keys inCanvas.tsxLinkSettingsandRichTextLinkSettingsref-page:/ref-collection:link prefixes so dynamic page links can follow a reference field value to its targetref-*link resolution ingenerateLinkHref(client) andlayerToHtml(SSR)richTextLinkmark handling inrenderTiptapToHtmlso rich text page/field/asset links render correctly on generated pagesPageRendererso specific item slugs and ref-* target collections are pre-fetchedhidePageContextOptionsprop to suppress "Current page item" and reference field options when editing CMS item content inCollectionItemSheetbuildReferenceItemOptionsutility andLinkItemOptionscomponent to keep link settings DRYREF_PAGE_PREFIX/REF_COLLECTION_PREFIXconstants tocollection-field-utilsto avoid circular dependencyPageRendererlink scanning into module-level pure utilities, replacing two separate tree traversals with a single shared passTest plan
CollectionItemSheetand confirm "Current page item" and reference field options are not shown