Skip to content

Instantly share code, notes, and snippets.

@loughlincodes
Last active March 25, 2021 19:33
Show Gist options
  • Save loughlincodes/d774bdd9ac121a1e2d554ec855c0632c to your computer and use it in GitHub Desktop.
Save loughlincodes/d774bdd9ac121a1e2d554ec855c0632c to your computer and use it in GitHub Desktop.
Section schema for blocks in Pages
<div class="some-div">
{% for block in section.blocks %}
{% case block.type %}
{% when 'image' %}
image
{% when 'headline' %}
headline
{% when 'text' %}
text
{% endcase %}
{% endfor %}
</div> <!-- end some-div -->
{% schema %}
{
"name": "Custom Page Layout",
"class": "custom-page-layout",
"settings": [],
"blocks": [
{
"type": "image",
"name": "Image Block",
"limit": 6,
"settings": [
{
"type": "image_picker",
"id": "image",
"label": "Image Block"
}
]
},
{
"type": "headline",
"name": "Headline Block",
"settings": [
{
"type": "text",
"id": "headline",
"label": "Headline Block"
}
]
},
{
"type": "text",
"name": "Text Block",
"settings": [
{
"type": "richtext",
"id": "textblock",
"label": "Text Block"
}
]
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment