Skip to content

Instantly share code, notes, and snippets.

@carolineschnapp
Created June 4, 2010 22:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save carolineschnapp/426020 to your computer and use it in GitHub Desktop.
Save carolineschnapp/426020 to your computer and use it in GitHub Desktop.
related-by-tags.liquid (snippet for Solo theme)
{% if product.tags.size > 0 %}
<!-- START RELATED -->
<div id="related">
<h6>{% if settings.related.size > 0 %}{{ settings.related | escape }}{% else %}Take a look at these great accessories:{% endif %}</h6>
<!-- START SLIDER -->
<div id="slider" class="clear">
<!-- START PREV -->
<div id="prev">
<p><a href="/collections/all" class="inactive">Previous</a></p>
</div>
<!-- END PREV -->
<!-- START WINDOW -->
<div id="window">
<ul class="clear">{% paginate collections.all.products by 1000 %}{% for prod in collections.all.products %}{% if product.tags contains prod.title %}
<li>
<div class="image clear">
<a href="{{ prod.url | within: collections.all }}"><img src="{{ prod.images[0] | product_img_url: "small" }}" alt="{{ product.title | escape }}" /></a>
</div>
<h4><a href="{{ prod.url | within: collections.all }}">{{ prod.title | escape }}</a></h4>
<p>{{ prod.price | money }}</p>
</li>{% endif %}{% endfor %}{% endpaginate %}
</ul>
</div>
<!-- END WINDOW -->
<!-- START NEXT -->
<div id="next">
<p><a href="/collections/all">Next</a></p>
</div>
<!-- END NEXT -->
</div>
<!-- END SLIDER -->
</div>
<!-- END RELATED -->
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment