Skip to content

Instantly share code, notes, and snippets.

@luukee
Last active April 29, 2025 10:25
Show Gist options
  • Select an option

  • Save luukee/0d7729db11fa1e9d6c9d544dd6431b8d to your computer and use it in GitHub Desktop.

Select an option

Save luukee/0d7729db11fa1e9d6c9d544dd6431b8d to your computer and use it in GitHub Desktop.
Shopify metafield dump
{% comment %}
Description:
Snippet to dump the metafields of an objectt in the console
Usage:
{% render 'dump-metafields' with article.metafields.blog.sections %}
or
{% render 'dump-metafields' with article.metafields.custom.sections %}
{% endcomment %}
<script type="text/javascript">
console.log('Metafields Data:', {{ dump-metafields | map: "value" | json }});
</script>
{% comment %}
Description:
Snippet to dump the content of an object in the console
Usage:
{% render 'dump' with [OBJECT] %}
{% endcomment %}
<script type="text/javascript">
console.log({{ dump | json }});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment