Use Thumbnails for Property Images in Filter
Please adjust the default template
Resources/views/storefront/component/listing/filter/filter-property-select.html.twig
so that when images are assigned to properties, the appropriate thumbnail images are used instead of the full original images.
Currently, the original image is loaded, which can negatively impact page load performance.
In our instance, I’ve already implemented a manual fix by replacing:
{% set media = element.media.url %}
with:
{% set media = element.media.thumbnails | filter(t => t.width == 100 and t.height == 100) | first.url %}
This ensures that a 100x100 thumbnail is used when available.
4
votes