templates/document/areabricks/banner-brick/view.html.twig line 1

Open in your IDE?
  1. {% set bannerCount = pimcore_numeric('bannerCount').getData()|default(1) %}
  2. <div class="grid gap-5 sm:grid-cols-2 xl:grid-cols-1">
  3.   {% if bannerCount > 0 %}
  4.     {% for i in range(1, bannerCount) %}
  5.       <a {% if not editmode %}href="{{ pimcore_link('link-' ~ i).href }}"{% endif %} target="_blank" class="block bg-primary">
  6.         {% if editmode %}
  7.           {{ pimcore_link('link-' ~ i) }}
  8.           {{pimcore_image('banner-' ~ i, {
  9.           "attributes":  {
  10.             "class": "w-full"
  11.           }
  12.         })}}
  13.         {% endif %}
  14.         {% if not pimcore_image('banner-' ~ i).isEmpty() and not editmode %}
  15.         {{ pimcore_image('banner-' ~ i, {
  16.           "attributes":  {
  17.             "class": "w-full"
  18.           }
  19.         }).thumbnail('banner-vertical').html({
  20.               pictureAttributes: { class: 'w-full' },
  21.               imgAttributes: { class: ' w-full ' }
  22.         })|raw }}
  23.         {% endif %}
  24.       </a>
  25.     {% endfor %}
  26.   {% endif %}
  27. </div>