Call to action on the landing page of shopify

call to action allows clients to drive visitor engagement to specific products, or carry out a specific activity, like creating an account or accessing content.

code for my call to action section would look like:

{% if section.settings.show_call_to_action == true %}
<div class="cta-section">
  <h3> {{ section.settings.text-box }} </h3>
  <button type="button">
    <a href="{{ section.settings.link }}" class="btn--secondary">{{ section.settings.linktext }}</a>
  </button> 
</div>
{% endif %}

{% schema %}
{
  "name": "Call to action",
  "settings": [
    {
      "type": "checkbox",
      "id": "show_call_to_action",
      "label": "Show call to action button",
      "default": false
    },
    {
      "id": "text-box",
      "type": "text",
      "label": "Heading"
    },
    {
      "id": "link",
      "type": "url",
      "label": "Button link"
    },
    {
      "id": "linktext",
      "type": "text",
      "label": "Button text",
      "default": "Click here"
    }
  ]
}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

Leave a comment

Your email address will not be published. Required fields are marked *