Skip to content

Conversation

@veken1199
Copy link
Contributor

@veken1199 veken1199 commented Dec 5, 2024

We are renaming context to closest in Dynamic Sources to avoid potential conflicts and build sustainably in the future.

For reference, here are examples of context usage in the theme code, and how they should appear once you rename to closest:

  1. With content_for liquid tag
// Current Usage:
{% content_for "blocks", context.product: product %}

// Updated Usage:
{% content_for "blocks", closest.product: product %}
  1. In json template data and presets
// Current Usage:
{{ context.product }}

// Updated Usage:
{{ closest.product }}

Follow the docs for more details:
https://shopify.dev/docs/storefronts/themes/architecture/blocks/theme-blocks/dynamic-sources

@veken1199 veken1199 merged commit 1878ef5 into main Dec 6, 2024
1 check passed
@tyleralsbury tyleralsbury deleted the rename-context-to-closest branch December 6, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants