Created
January 28, 2020 13:48
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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