Created
June 1, 2017 06:21
-
-
Save deepp2887/bbca9d681a070520fc605ddaf5fb67c2 to your computer and use it in GitHub Desktop.
Making dynamic block section in admin for shopify.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="pdp-section pdp-productInfo"> | |
<div class="wrapper pdp-productInfo__container"> | |
{% for block in section.blocks %} | |
<div class="pdp-productInfo__item" {{ block.shopify_attributes }}> | |
<div class="pdp-productInfo__image"> | |
<img src="{{ block.settings.image | img_url: '240x' }}"> | |
</div> | |
<div class="pdp-productInfo__content"> | |
<h4 class="pdp-col__heading">{{ block.settings.heading }}</h4> | |
<p class="pdp-col__text">{{ block.settings.content }}</p> | |
</div> | |
</div> | |
{% endfor %} | |
</div> | |
</div> | |
{% schema %} | |
{ | |
"blocks": [ | |
{ | |
"type": "text", | |
"name": "Product Info", | |
"settings": [ | |
{ | |
"type": "image_picker", | |
"id": "image", | |
"label": "Image" | |
}, | |
{ | |
"id": "heading", | |
"type": "text", | |
"label": "Heading" | |
}, | |
{ | |
"id": "content", | |
"type": "text", | |
"label": "Text" | |
} | |
] | |
} | |
] | |
} | |
{% endschema %} | |
{% stylesheet %} | |
{% endstylesheet %} | |
{% javascript %} | |
{% endjavascript %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment