Sections are used to host reusable modules of content that merchants can customize.

Section files are hosted in the sections directory of the theme.

Liquid in sections

Sections have the same access to global objects, tags, and filters as other Liquid theme files, as well as the following section-specific objects:

Sections also support the following Liquid tags, which are unique to sections:

Variable scope

Aside from global objects, variables created outside of sections aren't accessible within sections.

The section and block objects, as well as variables created within sections, aren't available outside of their respective section. The only exception is when you reference section and block objects within a snippet that's rendered inside the associated section.

Render a section

You can render sections in one of the following ways:

Statically render a section

You can statically render a section using the Liquid section tag.

For example, if you have a /sections/header.liquid file that contains your theme's header content, then you might want to include that section in theme.liquid so that the header is rendered on all pages that use that layout: