Difference between revisions of "Index.liquid"

From Spiffy Stores Knowledge Base

(New page: = Index.liquid = 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 promot...)
 
Line 13: Line 13:
 
<table id="products" cellspacing="0" cellpadding="0">
 
<table id="products" cellspacing="0" cellpadding="0">
 
   {% tablerow product in collections.home-page.products cols: 4 limit: 12 %}
 
   {% 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 }}{% if product.compare_at_price_max > product.price %}<div class="on-sale"></div>{% endif %}</div></div>
+
   <div class="product">
    <h3>{{ product.title | truncate: 42, '...'}}</h3>
+
    <a href="{{ product.url }}" onClick="document.location = '{{ product.url }}'">
    <br />
+
      <div class="product-image-container">
    <div class="money"> {% if product.price_min != product.price_max %}From {{ product.price_min | money }}{% else %}Only {{ product.price | money }}{% endif %} </div>
+
<div class="product-image">
     </a> </div>
+
  {% 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 %}
 
   {% endtablerow %}
 
</table>
 
</table>
 
{% endif %}</pre>
 
{% endif %}</pre>

Revision as of 17:48, 1 September 2008

Index.liquid

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.

<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 %}