Skip to content

Instantly share code, notes, and snippets.

@ed-codes
Last active September 12, 2018 15:40
Show Gist options
  • Save ed-codes/695d17d24552e32328e55eefa9c46ed9 to your computer and use it in GitHub Desktop.
Save ed-codes/695d17d24552e32328e55eefa9c46ed9 to your computer and use it in GitHub Desktop.
inside product template - link block settings to a specific product, allows varied content
{% for block in section.blocks %}
{% comment %}if this is the correct block for this product page{% endcomment %}
{% if block.settings.mala-product == product.handle %}
{% assign intro-heading = block.settings.page-title %}
{% assign intro-text = block.settings.intro-text %}
{% assign mala-box-1 = block.settings.mala-box-1 %}
{% assign mala-box-2 = block.settings.mala-box-2 %}
{% assign mala-box-3 = block.settings.mala-box-3 %}
{% assign about-material-heading = block.settings.about-material-heading %}
{% assign about-material-text = block.settings.about-material-text %}
{% assign specifications = block.settings.specifications %}
{% endif %}
<!-- Block Product: {{ block.settings.mala-product }} <br> -->
{% endfor %}
<!-- Product handle: {{ product.handle }} -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment