Skip to content

fix: support link fields as image and video sources#372

Merged
tristan-mouchet merged 2 commits into
developfrom
fix/cms-link-field-image-binding
Jun 18, 2026
Merged

fix: support link fields as image and video sources#372
tristan-mouchet merged 2 commits into
developfrom
fix/cms-link-field-image-binding

Conversation

@tristan-mouchet

Copy link
Copy Markdown
Collaborator

Summary

CMS link/URL fields could not be used as image or video sources in the builder, and a field-bound media element with an empty CMS value rendered as broken. This lets link/URL fields hold a media URL and falls back to the default placeholder when the value is empty.

Changes

  • Add link to IMAGE_FIELD_TYPES so the field selector offers link/URL fields for image, background, lightbox and page-settings bindings
  • Unwrap serialized CollectionLinkValue values to the underlying URL or asset id when resolving image and video sources
  • Show the default image/video placeholder when the resolved CMS value is empty or has no usable URL/asset

Test plan

  • Bind an image layer's source to a CMS link/URL field and confirm it appears as an option in the field selector
  • Verify the image renders correctly in the builder canvas and in the preview/published page
  • Set the CMS link field to empty/null and confirm the default placeholder image is shown (not a broken image)
  • Repeat for a background image bound to a link field
  • Verify a regular image field binding still works unchanged

Allow CMS link/url fields to be selected and rendered as image and
video sources, and fall back to the default placeholder when the bound
CMS value is empty.

- Add link to IMAGE_FIELD_TYPES so the field selector offers link/url
  fields for image, background, lightbox and page settings bindings
- Unwrap serialized CollectionLinkValue values to the underlying URL or
  asset id when resolving image/video sources
- Return the default image/video placeholder when the resolved CMS
  value is empty or has no usable URL/asset
The server-side collection render wrapped a link field's serialized
CollectionLinkValue as an asset id, so image/video/background sources
bound to link/url fields failed to resolve and fell back to the
default placeholder on preview and published pages. Unwrap the link
value to the underlying URL or asset id before building the variable.
@tristan-mouchet tristan-mouchet merged commit c9e7ef3 into develop Jun 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant