Skip to content

Instantly share code, notes, and snippets.

@joe-dempsey
Created January 28, 2020 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joe-dempsey/7540327692ff7b82b8248f0630f052ec to your computer and use it in GitHub Desktop.
Save joe-dempsey/7540327692ff7b82b8248f0630f052ec to your computer and use it in GitHub Desktop.
shopify list all products with image heights - to check validity of image assets on products
<article class="site-page page-{{ page.handle }}" data-template-page>
<header class="page-masthead">
<h1 class="page-title">
page displaying image sizes for all products
</h1>
</header>
<ul>
{% assign collection = collections.all-1 %}
{% paginate collection.products by 1000 %}
{% for product in collection.products %}
<li>
<div class="product">
<div class="product-name"><a href="{{ product.url }}">{{ product.title }} | {{ product.price | money }}</a></div>
{% assign images = product.media | where: "media_type", "image" %}
{% for image in images %}
<span {% unless image.height == 1242 %}style="background:red;"{% endunless %}>{{ image.height }}</span> |
{% endfor %}
</div>
</li>
{% endfor %}
{{ paginate | default_pagination }}
{% endpaginate %}
</ul>
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment