Layouts
A layout is the HTML around every page: <html>, <head>, the header and footer. Templates use layout/theme.liquid unless they choose another.
<!doctype html><html lang="{{ request.locale.iso_code }}" dir="{{ request.locale.direction }}"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>{{ page_title }}{% unless page_title == shop.name %} – {{ shop.name }}{% endunless %}</title> {%- if page_description != blank %}<meta name="description" content="{{ page_description }}">{% endif %} <link rel="canonical" href="{{ canonical_url }}"> {{ 'base.css' | asset_url | stylesheet_tag }} {{ content_for_header }} </head> <body class="template-{{ template.name | handle }}"> {% sections 'header-group' %} <main id="MainContent">{{ content_for_layout }}</main> {% sections 'footer-group' %} </body></html>Required output
Section titled “Required output”| Object | Where | What it adds |
|---|---|---|
content_for_header |
inside <head> |
hreflang links, robots meta on previews, analytics and pixels (after consent), the visual editor bridge |
content_for_layout |
inside <body> |
the template’s sections |
Set dir from request.locale.direction so the page flips for Arabic. See RTL and Arabic typography.
Choosing a layout
Section titled “Choosing a layout”- A JSON template:
"layout": "landing"useslayout/landing.liquid;"layout": falserenders without one. - A Liquid template:
{% layout 'landing' %}or{% layout none %}. - A custom page:
"layout"in its schema ("theme"by default,"none"for a bare page). - The password page uses
layout/password.liquidwhen the theme has it.
Was this page helpful?

