Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save shopifypartners/f625b7089a205f70f39e9d0cbc18b077 to your computer and use it in GitHub Desktop.
Save shopifypartners/f625b7089a205f70f39e9d0cbc18b077 to your computer and use it in GitHub Desktop.
How to Build Your First Shopify Section Block: Call To Action - https://www.shopify.com/partners/blog/shopify-section-block
<hr>
<div id="section-cta">
<div class="section-header text-center">
<h3> {{ section.settings.text-box }} </h3>
</div>
{% for block in section.blocks %}
<div class="btn" id="call-to-action">
<a href="{{ block.settings.link }}" class="btn">{{ block.settings.linktext }}</a>
</div>
{% endfor %}
</div>
<hr>
{% schema %}
{
"name": "CTA Blocks",
"max_blocks": 3,
"settings": [
{
"id": "text-box",
"type": "text",
"label": "Heading",
"default": "Title"
}
],
"blocks": [
{
"type": "select",
"name": "Add Button",
"settings": [
{
"id": "link",
"type": "url",
"label": "Button link"
},
{
"id": "linktext",
"type": "text",
"label": "Button text",
"default": "Click here"
}
]
}
],
"presets": [
{
"name": "Call to Action Blocks",
"category": "CTA button",
"blocks": [
{
"type": "select"
},
{
"type": "select"
}
]
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment