Difference between revisions of "Liquid Variable Reference"
From Spiffy Stores Knowledge Base
m (→Requirements) |
|||
Line 14: | Line 14: | ||
=== index.liquid === | === index.liquid === | ||
− | This template creates your | + | This template creates your store's home page. It is not directly related to any given resource of your store in the same way that product.liquid is. |
− | Because | + | Because it does not refer to a specific resource, index.liquid makes use of the global objects referenced below. You are free to use any objects (product, collection, page, etc.) in your store from here. |
− | By convention the default themes will render all articles of a blog with handle | + | By convention the default themes will render all articles of a blog with the handle home-page, if it exists, and will display products from a collection with the handle home-page. Both of these objects are created automatically during the Spiffy Stores signup when your new store is created. |
=== product.liquid === | === product.liquid === |
Revision as of 17:59, 1 September 2008
Following is a reference-list of objects which you can use in your liquid templates. For an introduction to liquid templates you can check out the Liquid Basics page.
Contents
Requirements
Following variables have to be included in every liquid theme file such as the theme.liquid.
{{content_for_header}}
{{content_for_layout}}
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.
index.liquid
This template creates your store's home page. It is not directly related to any given resource of your store in the same way that product.liquid is.
Because it does not refer to a specific resource, index.liquid makes use of the global objects referenced below. You are free to use any objects (product, collection, page, etc.) in your store from here.
By convention the default themes will render all articles of a blog with the handle home-page, if it exists, and will display products from a collection with the handle home-page. Both of these objects are created automatically during the Spiffy Stores signup when your new store is created.
product.liquid
The referenced product with several variants.
blog.liquid
blog which has several article 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
Global objects
Following objects are available from any liquid template in the system. You can use those
* cart * collections * linklists * pages * blogs * shop * template