1
 {% for icon in icons %}
                    {% set image = icon.icon.one() ?? null %}
                    {% if image %}
                        <div class="c c-md-6 c-lg-6">
                            <div class="icon">
                                <div class="image">
                                    <figure>
                                        <img src="{{ image.getUrl('medium') }}" sizes="100vw" srcset="{{ image.getUrl('small') }} 320w, {{ image.getUrl('medium') }} 640w" alt="{{ image.title }}">
                                        <figcaption>{{ icon.title }}</figcaption>
                                    </figure>
                                </div>
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}

1 Answer 1

1
{% if image.extension == 'svg' %}
  <img src="{{ image.url }}" ... />
{% else %}
  ...
{% endif %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.