Search our shop

Adding a section to a site

Template > Section > Snippet

Template

section-name.liquid

The homepage section is called from the template, and passed in as a section type. this template also includes the homepage schema, which allows for the use of blocks inside the schema.

{% include 'include-section-name', type: 'section' %} {% schema %} {% endschema %}

Backpage sections are called from their relative templates, but are passed in as blocks. The schema for backpages therefore cannot contain blocks, so these must be separated out into their own settings in the json.

{% elsif block.type == "section-name" %} {% include 'include-section-name', type: 'block' %} {% endif %}

Section

include-section-name.liquid

The section contains the code, and uses logic to determine if it is a section (homepage) or a block (back pages).

Phil Penny

Phil Penny

Head of Design & Development