Skip to content

Commit

Permalink
feat: add comment and spaceless to thumbnail_utility
Browse files Browse the repository at this point in the history
(cherry picked from commit 5dcc35c)
  • Loading branch information
tinect committed Mar 11, 2024
1 parent 684c855 commit 0ca3f22
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Resources/views/storefront/utilities/thumbnail.html.twig
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{% sw_extends "@Storefront/storefront/utilities/thumbnail.html.twig" %}

{% block thumbnail_utility %}
{% block thumbnail_utility %}{% apply spaceless %}
{% if lazysizes is not defined %}
{% set lazysizesThroughCss = null %}
{% for item in [sectionClasses, blockClasses] %}
{% if item is defined %}
{# Yes, item is an array!
Therefore we need to combine any entry and convert it back to array #}
{% set item = item|join(' ')|split(' ') %}

{% if 'no-lazysizes' in item %}
{% set lazysizesThroughCss = false %}
{% elseif 'lazysizes' in item %}
Expand All @@ -22,4 +25,4 @@
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% endapply%}{% endblock %}

0 comments on commit 0ca3f22

Please sign in to comment.