Theme.liquid

From Shopify Wiki

Jump to: navigation, search

Overview

The file theme.liquid is basically a HTML/XHTML file that contains liquid tags. That being said, you will want everything that a standard index.html has:

  • A doctype specifying whether it's transitional or strict
  • a head tag
  • a body tag

It represents all the static content of your shop.

You must include the following two lines somewhere in it

  • main content area:
    {{ content_for_layout }}
  • head section:
    {{ content_for_header }}

The dynamic content(meaning all the other liquid templates being found in ../templates) such as the products screen or articles are rendered at the position where you included this tag.

Most likely you will want to specify javascript and stylesheet includes in the head tag of this file.

An example of a javascript include tag with a liquid filter

{{ 'shop.js' | asset_url | script_tag }}

An example of a stylesheet include tag with a liquid filter

{{ 'shop.css' | asset_url | stylesheet_tag }}

Variables

In this file you have access to the following liquid variables:

Personal tools