Shopify themes, liquid, logos, and UX
My main shopping page currently links images to COLLECTIONS but sometimes when there is only a single item in a collection, I would like to directly link to the item from the shopping page. Currently when I do this, the thumbnail on the shopping page shows a blank square with "no image available."
I am using the Minimal Theme. Shopfiy Help Center says to look in the Sections directory and click on 'collection-template.liquid' and look for a line like:
"In the code editor, look for the code that controls the product display. You might find a line like {%paginate collection.products by 9%}'
I am able to find this in my code: {% paginate collection.products by settings.pagination_limit %}
I am advised to then ensure that the product image code is included in the product loop. It might look something like this:
<img src=\"{{ product.featured_image | img_url: 'medium' }}\" alt=\"{{ product.title }}\">
I'm not sure where to find that or how to add it to the code so the lead product image will display on the shopping page. Any advice?
Hi @katagolda
I understand you're having trouble displaying product images on your main shopping page in the Minimal theme when linking directly to a product (especially when a collection only has one item). You're currently seeing that "no image available" placeholder, which isn't ideal. Let's fix that.
The Shopify Help Center's advice is on the right track, but it can be a little vague. Here's a more specific breakdown of how I'd approach this:
The issue is that your main shopping page is likely set up to display collections, not individual products. When a collection has only one product, and you link directly to that product, the template designed for collections doesn't know how to handle displaying a single product's image directly. It's expecting a collection image or a placeholder.
You're correct that the collection-template.liquid file is important. However, since you're linking directly to products on your shopping page, you'll likely need to modify the template that controls how products are displayed within collections and potentially the template for your main shop page (if it's using a custom template).
1-Open collection-template.liquid: In your Shopify admin, go to Online Store > Themes > Edit Code. Then, navigate to the Sections folder and open collection-template.liquid.
2-Find the Product Loop: As you've already found, the product loop is usually something like {% paginate collection.products by settings.pagination_limit %}. Inside this loop (between the {% for product in collection.products %} and {% endfor %} tags), you'll need to add the code for the product image.
3-Add the Image Code: This is the key part. Here's the code you should add within the product loop:
<a href="{{ product.url }}"> <img src="{{ product.featured_image | img_url: 'medium' }}" alt="{{ product.title }}"> </a>
Example: Here's how it should look within the loop:
{% for product in collection.products %}
<div class="product-item">
<a href="{{ product.url }}">
<img src="{{ product.featured_image | img_url: 'medium' }}" alt="{{ product.title }}">
</a>
<h3>{{ product.title }}</h3>
<p>{{ product.price | money }}</p>
</div>
{% endfor %}
4-Check Your Main Shop Page Template (Important!): If your main shop page is using a different template (maybe something like page.liquid in the Templates folder or a custom section within index.json), you'll need to add similar code there as well, wherever you're displaying the links to products. This is the part that was likely missing from the Shopify Help Center advice. If you're using collections on the shop page, the above solution will work. However, if you're directly listing products on the shop page, you'll need a similar loop but instead of collection.products, you'll likely use a list of products that you have manually created or a different variable depending on your theme.
By adding the image code inside the product loop in the correct template(s), you ensure that the product's featured image is displayed, even if it's the only product in a collection. This should completely resolve the "no image available" issue.
In my experience, themes sometimes have slightly different structures. If you're still having trouble after trying this, double-check your theme's documentation or consider reaching out to the theme developer for support. They can provide more specific guidance based on how your theme is coded.
If you need any other assistance, I am willing to help.
Best regards,
Daisy.
Wow @DaisyVo ! Thank you so much for all of this information.
I *think* I understand what I need to do, but also don't really speak this language so I'm wondering if you can handhold a bit more. I tried to copy and past the recommended language into the place where I *think* it is supposed to go, saved the template, refreshed my collection page, and the image is still not showing up. I tried putting your code in after the line: {% for product in collection.products %}
so it was before the line: {% include 'product-loop' with collection.handle %}
This is the section of code that I think I am supposed to be working in? But maybe I'm wrong...
<!-- Begin no products -->
{% if collection.products.size == 0 %}
<div class="row">
<div class="span12 expanded-message">
<p>No products found</p>
</div>
</div>
{% endif %}
<div class="row products">
{% for product in collection.products %}
{% include 'product-loop' with collection.handle %}
{% endfor %}
</div>
My main shop page does not show any collections/products.
This is my shopping page, you can see the blank image at the very bottom: https://www.katagolda.com/collections
Your help is so very appreciated!
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025