VariableReference

From Shopify Wiki

Revision as of 17:25, 20 December 2011 by Dennis (Talk | contribs)
Jump to: navigation, search

Following is a reference-list of objects which you can use in your liquid templates. For a introduction to liquid templates you can check out the UsingLiquid page.

Contents

Requirements

The following variables must be included in your theme's layout file (theme.liquid).

Template specific objects

Special purpose templates usually export the object they reference by the same name as the template file. Product.liquid, for example, would export a product object which references the current product on the page.

product.liquid

The referenced product with several variants.

blog.liquid

blog which has several article objects.

article.liquid

article which has several comment objects.

collection.liquid

collection which references several product and tags objects. Collections usually make use of pagination.

page.liquid

page

cart.liquid

cart with many line_items

Email templates

All current email templates shown in your Email & Notifications Preferences screen have access to the properties of their respective order.

Shipping notification templates

The Shipping confirmation and Shipping update templates have access to a fulfillment object.

Global objects

The following objects are available from any liquid template in your shop's theme.

In addition, current_tags is available in both collection.liquid and blog.liquid.