Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename context to closest #67

Merged
merged 1 commit into from
Dec 6, 2024
Merged

Rename context to closest #67

merged 1 commit into from
Dec 6, 2024

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