Difference between revisions of "Index.liquid"

From Spiffy Stores Knowledge Base

 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
= Index.liquid =
+
The index.liquid file is the home page for your store. You will want to use this page to highlight information about your store and any featured products or offers that you want to promote.
 
 
This is the home page for your store. You will want to use this page to highlight information about your store and any featured products or offers that you want to promote.
 
  
 
The following code shows a sample index page which displays the content from the '''home-page''' page, and then displays all the products in the '''home-page''' collection.
 
The following code shows a sample index page which displays the content from the '''home-page''' page, and then displays all the products in the '''home-page''' collection.
Line 24: Line 22:
 
       <br />
 
       <br />
 
       <div class="money">
 
       <div class="money">
{% if product.price_min != product.price_max %}From {{ product.price_min | money }}{% else %}Only {{ product.price | money }}{% endif %}
+
{% if product.price_min != product.price_max %}
 +
  From {{ product.price_min | money }}
 +
{% else %}
 +
  Only {{ product.price | money }}
 +
{% endif %}
 
       </div>
 
       </div>
 
     </a>
 
     </a>
Line 31: Line 33:
 
</table>
 
</table>
 
{% endif %}</pre>
 
{% endif %}</pre>
 +
 +
==Variables==
 +
 +
There are no additional variables for the index.liquid template. All [[Liquid Variable Reference#Global objects|global variables]] are available.

Latest revision as of 08:35, 1 December 2011

The index.liquid file is the home page for your store. You will want to use this page to highlight information about your store and any featured products or offers that you want to promote.

The following code shows a sample index page which displays the content from the home-page page, and then displays all the products in the home-page collection.

<div class="textile">
  {{ pages.home-page.content }}
</div>
<h2>Our best sellers...</h2>
{% if collections.home-page.products.size > 0 %}
<table id="products" cellspacing="0" cellpadding="0">
  {% tablerow product in collections.home-page.products cols: 4 limit: 12 %}
  <div class="product">
    <a href="{{ product.url }}" onClick="document.location = '{{ product.url }}'">
      <div class="product-image-container">
	<div class="product-image">
	  {% capture product_title %}{{ product.title | escape }}{% endcapture %}
	  {{ product.featured_image | product_img_url: 'small' | img_tag: product_title }}
	</div>
      </div>
      <h3>{{ product.title | truncate: 42, '...'}}</h3>
      <br />
      <div class="money">
	{% if product.price_min != product.price_max %}
	  From {{ product.price_min | money }}
	{% else %}
	  Only {{ product.price | money }}
	{% endif %}
      </div>
    </a>
  </div>
  {% endtablerow %}
</table>
{% endif %}

Variables

There are no additional variables for the index.liquid template. All global variables are available.