A dynamic source is a saved connection, not a copied value. The editor stores its expression in the authored settings tree; the runtime resolves compatible values for the page being rendered. Do not replace the authored expression with a one-time preview value.

Resource context

  • Template reads the resource whose page is open.
  • Section reads the resource selected for the containing section.
  • Closest reads the nearest resource, including the current product in a repeated product card.
  • Store fields and explicitly selected metaobject entries can supply store-wide content.

A product selected for a section must establish that section's context without changing the template product. Repeated product cards must establish each card's closest context. Clearing a resource connection must not revive an old saved product as a fallback.

Public resolution helpers

Import resolveThemeSettingValue, resolveThemeDynamicSettings, resolveThemeResourceContext and resolveThemePresentationNode from @upstorr/theme-sdk/v1 when implementing a custom renderer. Read their current signatures in the generated SDK reference.

resolveThemePresentationNode creates resolved presentation inputs without changing the authored tree, including nested blocks and connected-state information. Global connected settings need their declared schema type. Use the native section renderer where possible instead of resolving connections independently in multiple layers.

Only compatible settings and public resources are offered. Text, rich text, media, links and resource selectors have different accepted field types. Unavailable or incompatible connections can resolve empty; do not invent content or reveal a private field to fill them.

Liquid formatting

{{ product.metafields.custom.care | metafield_text }}
{{ product.metafields.custom.care | metafield_tag }}

Pass the typed metafield object, not just .value. metafield_text supplies readable text. metafield_tag supplies supported, sanitised HTML and list markup. Do not use raw as a substitute for typed sanitisation.

Formatting does not grant storefront access, fetch private data, connect an editor setting or hide an entire empty row. Implement any empty-state visibility deliberately in the theme and verify the rendered result.

Verification

Test template, section and repeated-card contexts with different real products; missing and cleared values; text/list/rich-text/media types; private fields; and connect/disconnect followed by Undo and Redo. Inspect both the saved connection and the visible preview. A correct right-panel label alone does not prove the rendered resource is correct.

Installed compiled theme versions must support the connection contract. Updating the SDK source does not upgrade a merchant's pinned compiled theme automatically.