Skip to content

Instantly share code, notes, and snippets.

@xerosai
Created January 17, 2018 19:38
Show Gist options
  • Save xerosai/96399e6385cd50e808288d9aaaf9a233 to your computer and use it in GitHub Desktop.
Save xerosai/96399e6385cd50e808288d9aaaf9a233 to your computer and use it in GitHub Desktop.
Simple HTML Section for Shopify Themes
{% comment %}
Created by: Simon Neufville
Generic HTML section that can be placed anywhere in the customizer.
{% endcomment %}
<div class="shopify-section" data-section-id="{{ section.id }}">
{% if section.settings.heading %}
<h4 class="section-title">{{ section.settings.heading }}</h2>
{% endif %}
<div>
{{ section.settings.html_content }}
</div>
</div>
{% schema %}
{
"name": "Text Block",
"settings": [
{
"type": "text",
"id": "heading",
"label": "Section Title (optional)"
},
{
"type": "html",
"id": "html_content",
"label": "Custom HTML",
"default": "<div><p>Enter HTML content</p></div>"
}
],
"presets": [
{
"name": "Text Block",
"category": "Custom Text Block"
}
]
}
{% endschema %}
{% comment %}
Add styling as required
{% endcomment %}
{% stylesheet %}
{% endstylesheet %}
{% comment %}
Add JavaScript as required
{% endcomment %}
{% javascript %}
{% endjavascript %}
@b14cksun
Copy link

b14cksun commented Jan 3, 2022

nice but its too simple needs a little customization to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment