Forked from shopifypartners/how-to-build-your-first-section-block-call-to-action.liquid
Created
September 9, 2021 11:27
How to Build Your First Shopify Section Block: Call To Action - https://www.shopify.com/partners/blog/shopify-section-block
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
<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