Created
August 19, 2010 05:08
-
-
Save gterrill/537099 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
You can use this snippet to display categories on the front page. Turn on this snippet using theme settings. | |
{% endcomment %} | |
{% if linklists.categories.links.size > 0 %} | |
<div id="products"> | |
{% for link in linklists.categories.links %} | |
<div class="product {% cycle 'first_col', '', '', 'last_col' %}"> | |
{% assign collection = link.object %} | |
{% if collection.products.size > 0 %} | |
{% assign product = collection.products.first %} | |
<div class="image"> | |
<a href="{{ collection.url }}" title="{{ collection.title | escape }}"> | |
<img src="{{ product.images.first | product_img_url: 'compact' }}" alt="{{ collection.title | escape }}"/> | |
</a> | |
</div> | |
<div class="info"> | |
<div class="title ellipsis"><a href="{{ collection.url }}">{{ collection.title | escape }}</a></div> | |
</div> | |
{% endif %} | |
</div> | |
{% endfor %} | |
</div> | |
{% else %} | |
<p class="instructions">To view a category listing, <a href="/admin/links">create a link list</a> name "Categories", and insert links to your category collections.</p> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment