{#
project: Pimcore
User: EBiermann
Year: 2022
#}
{% if editmode %}
<div class="admin-container admin-container--limited-width">
<div class="admin-container__section">
<span class="admin-container__title">{{ 'brick.image.title'|trans({}, 'admin') }}</span>
</div>
<div class="admin-container__configurations">
<div class="admin-config-item">
<span class="admin-config-item__label">{{ 'brick.image.option.link'|trans({}, 'admin') }}:</span>
{{
pimcore_link('link', { 'noText': true })
}}
<br>
<span class="admin-config-item__label">{{ 'brick.image.option.border'|trans({}, 'admin') }}:</span>
{{
pimcore_checkbox('border', { 'reload': true })
}}
</div>
</div>
</div>
{% endif %}
{% set sectionIndex = sectionIndex|default(0) %}
{% set gridIndex = gridIndex|default(0) %}
<!-- thumb: {{ thumbnail }} | section-idx: {{ sectionIndex }} | grid-idx: {{ gridIndex }} -->
<div class="area image {{ cssClasses|join(' ') }}" style="{{ cssStyles|join(' ') }}">
{# LCP, should not be lazy loaded (images on init page load abvoe the fold) #}
{% set preventLoadingLazy = not editmode and (sectionIndex == 0 and gridIndex <= 1) %}
{%
set content = pimcore_image('image', {
'class': 'image__image',
'lowQualityPlaceholder': false,
'thumbnail': thumbnail|default(false),
'imgAttributes': {
'loading': preventLoadingLazy ? 'eager' : 'lazy',
'decoding': editmode ? 'sync' : 'async'
}
})
%}
{% if not editmode and hasLink %}
{%
include 'includes/partials/link-wrapper.html.twig' with {
content: content,
href: pimcore_link('link').getHref(),
title: pimcore_link('link').getTitle()
}
%}
{% else %}
{{ content|raw }}
{% endif %}
</div>