Skip to content

Instantly share code, notes, and snippets.

@bjornbennett
Created May 3, 2018 03:41
Show Gist options
  • Save bjornbennett/49cd45307d553795d66f7d73ee0986de to your computer and use it in GitHub Desktop.
Save bjornbennett/49cd45307d553795d66f7d73ee0986de to your computer and use it in GitHub Desktop.
Shopify Liquid - This snippets shows a collections products anywhere. It grabs their image information, and outputs it to a new image. The product title displays in an h4 tag. Wrap these in div containers to control flow. Also limit the amount of images to create a set amount.
{% for product in collections.example.products %}
<img src="{{ product.images[0] | product_img_url: "compact" }}" alt="{{ product.title | escape }}" />
<h4>{{ product.title }}</h4>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment