Skip to content

Instantly share code, notes, and snippets.

View estrattonbailey's full-sized avatar

Eric Bailey estrattonbailey

View GitHub Profile
{% unless filter_options %}
{% capture _filter_options %}
{% for tag in collection.all_tags %}{% if tag contains 'filter-' %}{{ tag | remove: 'filter-' | strip }} {%endif%}{%endfor%}
{% endcapture %}
{% assign filter_options = _filter_options | split: ' ' %}
{% endunless %}
{% assign current_option = 'none' %}
{% capture _filters %}
{% for tag in filter_options %}
@estrattonbailey
estrattonbailey / list-collections.liquid
Created July 17, 2015 16:51
Shopify Collections Listing Image Fallbacks
{% if collection.image %}
<a href="{{ collection.url }}" class="collection__image" style="background-image: url('{{ collection.image | img_url: 'grande' }}');">
<div class="collection__image__inner"></div>
{% else %}
{% if collection.products_count > 0 %}
{% assign collection_no_images = false %}
{% for product in collection.products %}
{% if product.featured_image %}
{% assign collection_fallback_img = product.featured_image %}
{% break %}