Difference between revisions of "Liquid Template Variables - products"

From Spiffy Stores Knowledge Base

(New page: The liquid variable '''products''' contains a collection of all of the store's products. You can access any page by using the page handle to index...)
 
Line 1: Line 1:
 
The liquid variable '''products''' contains a collection of all of the store's [[Liquid_Template_Variables_-_product|products]].
 
The liquid variable '''products''' contains a collection of all of the store's [[Liquid_Template_Variables_-_product|products]].
  
You can access any page by using the page handle to index the pages contained within the '''pages''' variable.
+
You can access any product by using the product handle to index the products contained within the '''products''' variable.
  
<pre><h1>{{ pages.about.title }}</h1>
+
<pre><h1>{{ products.cotton-hat.title }}</h1>
<p>{{ pages.about.author }} says...</p>
+
<p>{{ products.cotton-hat.description }}</p></pre>
<div>{{ pages.about.content }}</div></pre>
 
  
This example allows you to access the content of the '''about''' page.
+
This example allows you to access the description of the '''cotton-hat''' product.
 
 
This can be used to "imbed" pages within any other template, or even the layout.
 

Revision as of 16:59, 12 September 2008

The liquid variable products contains a collection of all of the store's products.

You can access any product by using the product handle to index the products contained within the products variable.

<h1>{{ products.cotton-hat.title }}</h1>
<p>{{ products.cotton-hat.description }}</p>

This example allows you to access the description of the cotton-hat product.