Shopify themes, liquid, logos, and UX
I have created collection tile images mainly for mobile users, but after I loaded them, my website performance took a hit, and they seem to be giving me poor cls. I ran the test, and it came back with properly sized images.
example: <img srcset="//created4ucreations.com/cdn/shop/collections/Tail-Wagging_and_Purr-Fect_P…" src="https://created4ucreations.com/cdn/shop/collections/Tail-Wagging_and_Purr-…" sizes=" (min-width: 1600px) 500px, (min-width: 75…" alt="Dog Mats, Dog Boned Shaped Mats, Pet Welcome Mats" height="1600" width="1600" loading="lazy" class="motion-reduce">
How do I fix this? I have loaded smaller images, I have loaded jpg, instead of png, I have loaded 800x800 and I still get this.
Solved! Go to the solution
This is an accepted solution.
Hi @tabel69 ,
May I suggest to update code these steps:
1. Go to Store Online-> theme -> edit code
2. Sections/main-collection-banner.liquid
3.Remove 2 attributes( srcset and sizes) of images.
I will try this today... and get back to you. And thank YOU if this works!! Either way... thank you for even responding... I appreciate the guidance!
-tina
I did it... and I still get the same result. Matter of fact my performance worsen. And they still show up on my report.
Maybe I need to give it more time to take?
Any other suggestions? I really like having the collection tile images... I think it helps via when using the mobile version but maybe I need to remove them and just use text squares.
Hi,
Could you give the content of this file? I will help you remove it.
I'm not sure what you mean by "content of this file". www.created4ucreations.com if you go via mobile device you will see my collection images. It is those images that seems to be the issue.
{% comment %}theme-check-disable ImgLazyLoading{% endcomment %}
{{ 'component-collection-hero.css' | asset_url | stylesheet_tag }}
{%- style -%}
@media screen and (max-width: 749px) {
.collection-hero--with-image .collection-hero__inner {
padding-bottom: calc({{ settings.media_shadow_vertical_offset | at_least: 0 }}px + 2rem);
}
}
{%- endstyle -%}
<div class="collection-hero{% if section.settings.show_collection_image and collection.image %} collection-hero--with-image{% endif %} color-{{ section.settings.color_scheme }} gradient">
<div class="collection-hero__inner page-width {% if settings.animations_reveal_on_scroll %} scroll-trigger animate--fade-in{% endif %}">
<div class="collection-hero__text-wrapper">
<h1 class="collection-hero__title">
<span class="visually-hidden">{{ 'sections.collection_template.title' | t }}: </span>
{{- collection.title | escape -}}
</h1>
{%- if section.settings.show_collection_description -%}
<div class="collection-hero__description rte">{{ collection.description }}</div>
{%- endif -%}
</div>
{%- if section.settings.show_collection_image and collection.image -%}
<div class="collection-hero__image-container media gradient">
<img
src="{{ collection.image | image_url: width: 750 }}"
alt="{{ collection.image.alt | escape }}"
width="{{ collection.image.width }}"
height="{{ collection.image.height }}"
>
</div>
{%- endif -%}
</div>
</div>
{% schema %}
{
"name": "t:sections.main-collection-banner.name",
"class": "section",
"settings": [
{
"type": "paragraph",
"content": "t:sections.main-collection-banner.settings.paragraph.content"
},
{
"type": "checkbox",
"id": "show_collection_description",
"default": true,
"label": "t:sections.main-collection-banner.settings.show_collection_description.label"
},
{
"type": "checkbox",
"id": "show_collection_image",
"default": false,
"label": "t:sections.main-collection-banner.settings.show_collection_image.label"
},
{
"type": "color_scheme",
"id": "color_scheme",
"label": "t:sections.all.colors.label",
"default": "scheme-1"
}
]
}
{% endschema %}
I think I figured out what you meant... so I copied and pasted the whole section. And thank you!!!
This is an accepted solution.
My performance bumped up to a 67... so I gained 20 points in the right direction! Thank you!! Now I have one more issue... that maybe you know the work around too. I have looked to see how to maybe changed it from hoover default to static but I don't see it.
How do I mange this or code it?
But first - let me say thank you for your help. Sorry for the delay, I had grandchildren for past week and half, and working on my website had to take a back seat.
-tina
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025