No Image placeholder on cellection grid page in Minimal theme

Highlighted
Excursionist
77 7 12

Hello dear community,

I want to show a image placeholder in the collection pages if there's no picture available. I created a no-image.png, uploaded that in Assets, and I could manage that in the product page this picture is shown if there's no picture uploaded.

Now I try to show this placeholder in the collection grid, there's still just nothing to see at the moment.

I think it should be in the "product-grid-item.liquid". I guess it's the line

<img src="{{ featured.featured_image.src | img_url: 'large' }}" alt="{{ featured.featured_image.alt | escape }}" class="product__img"

I just don't get it how I can connect it with the code

{% if product.images.size == 0 %}
{{ 'no-image.png' | asset_url | img_tag }}
{% endif %}

My page:

menschenskinder.myshopify.com

PW vuffey

Thank you so much for any input!!

Simonski

0 Likes
Highlighted
Excursionist
77 7 12

What I tried to implement, was as follows, but it doesn't work:

{% if product.images.size == 0 %}
	<img src="{{ 'no-image.png' | asset_url | img_tag | img_url: 'large'}}" class="product__img" data-image>
{% else%}
	<img src="{{ featured.featured_image.src | img_url: 'large' }}" alt="{{ featured.featured_image.alt | escape }}" class="product__img" data-image>
{% endif %}
0 Likes