{% set bannerCount = pimcore_numeric('bannerCount').getData()|default(1) %}
<div class="grid gap-5 sm:grid-cols-2 xl:grid-cols-1">
{% if bannerCount > 0 %}
{% for i in range(1, bannerCount) %}
<a {% if not editmode %}href="{{ pimcore_link('link-' ~ i).href }}"{% endif %} target="_blank" class="block bg-primary">
{% if editmode %}
{{ pimcore_link('link-' ~ i) }}
{{pimcore_image('banner-' ~ i, {
"attributes": {
"class": "w-full"
}
})}}
{% endif %}
{% if not pimcore_image('banner-' ~ i).isEmpty() and not editmode %}
{{ pimcore_image('banner-' ~ i, {
"attributes": {
"class": "w-full"
}
}).thumbnail('banner-vertical').html({
pictureAttributes: { class: 'w-full' },
imgAttributes: { class: ' w-full ' }
})|raw }}
{% endif %}
</a>
{% endfor %}
{% endif %}
</div>