Skip to content

Instantly share code, notes, and snippets.

@fredryk
Created July 1, 2014 15:50
Show Gist options
  • Select an option

  • Save fredryk/b2455d3d905b2f0a7715 to your computer and use it in GitHub Desktop.

Select an option

Save fredryk/b2455d3d905b2f0a7715 to your computer and use it in GitHub Desktop.
first image if no collection image through link-list
{% if link.type == 'collection_link' %}
{% assign collection = link.object %}
<a href="{{ link.url }}" title="Browse our {{ link.object.title | escape }} collection.">
{% if collection.image %}{{ collection.image.src | collection_img_url: 'medium' | img_tag: collection_title }}{% else %}{{ collection.products.first.featured_image | product_img_url: 'medium' | img_tag: collection_title }}{% endif %}
</a>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment