custom/static-plugins/NdVoorwindenTheme/src/Resources/views/storefront/element/cms-element-hero.html.twig line 1

Open in your IDE?
  1. {% block element_hero %}
  2.     {% block element_hero_button_var %}
  3.         {% set button = element.config.button.value %}
  4.     {% endblock %}
  5.     {% set image_desktop = element.data.get('images').image_1_desktop %}
  6.     {% set image_mobile = element.data.get('images').image_2_mobile %}
  7.     {% set heroUrlActive = element.config.hero_url.value %}
  8.     {% set heroUrl = element.config.hero_url_text.value %}
  9.     {% if element.config.hero_url.value %}
  10.         <a class="block h-full w-full" href="{{ element.config.hero_url_text.value }}">
  11.     {% endif %}
  12.     <div class="hero-container relative">
  13.         <div class="hero-images ratio ratio_5x4 md:ratio_3x1 bg-grey-300">
  14.             {% sw_thumbnails 'cms-image-thumbnails' with {
  15.                 media: image_desktop,
  16.                 attributes: {
  17.                     'class': 'hero-image-desktop hidden md:block',
  18.                     'alt': (image_desktop.translated.alt ?: ''),
  19.                     'title': (image_desktop.translated.title ?: '')
  20.                 }
  21.             } %}
  22.             {% sw_thumbnails 'cms-image-thumbnails' with {
  23.                 media: image_mobile,
  24.                 attributes: {
  25.                     'class': 'hero-image-mobile md:hidden',
  26.                     'alt': (image_desktop.translated.alt ?: ''),
  27.                     'title': (image_desktop.translated.title ?: '')
  28.                 }
  29.             } %}
  30.         </div>
  31.         {% block hero_background_placeholder %}
  32.             <div class="hidden background-placeholder absolute inset-0 bg-[#000000]/[.3]"></div>
  33.         {% endblock %}
  34.         {% block element_hero_content %}
  35.             <div class="absolute top-0 left-0 w-full h-full p-4 flex flex-col justify-end {% if element.config.text_color.value %} text-grey-600 {% else %} text-white #{!important} {% endif %} md:justify-center md:px-8">
  36.                 <div class="w-full h-full boxed-layout flex flex-col justify-end md:justify-center">
  37.                     {% if element.config.subtitle.value %}
  38.                         <div class="hero-label font-bold text-sm font-accent tracking-wider md:text-base">
  39.                             {{ element.config.subtitle.value }}
  40.                         </div>
  41.                     {% endif %}
  42.                     {% if element.config.title.value %}
  43.                         <h1 class="hero-title font-display font-bold text-4xl tracking-tight md:text-6xl mt-2 -ml-0 md:-ml-1">
  44.                             {{ element.config.title.value }}
  45.                         </h1>
  46.                     {% endif %}
  47.                     {% if element.config.text.value %}
  48.                         <div class="hero-description font-body text-sm max-w-[600px] md:text-base mt-2">
  49.                             {{ element.config.text.value }}
  50.                         </div>
  51.                     {% endif %}
  52.                     {% if element.config.button.value.active and not heroUrlActive %}
  53.                         <span>
  54.                         <a class="{% if elongated %} btn-link {% else %}btn rounded-sm {{ element.config.button.value.type }}{% endif %} tracking-wider mt-2 md:max-w-fit z-50"
  55.                            href="{{ element.config.button.value.url }}"
  56.                            {% if element.config.button.value.newtab %}target="_blank"{% endif %}>
  57.                             {{ element.config.button.value.text }}
  58.                             {% if not elongated %}
  59.                                 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
  60.                                      stroke-width="1.5"
  61.                                      stroke="currentColor" class="w-4 h-4">
  62.                                     <path stroke-linecap="round" stroke-linejoin="round"
  63.                                           d="M8.25 4.5l7.5 7.5-7.5 7.5"/>
  64.                                 </svg>
  65.                             {% endif %}
  66.                         </a>
  67.                             </span>
  68.                     {% endif %}
  69.                 </div>
  70.             </div>
  71.         {% endblock %}
  72.     </div>
  73.     {% if element.config.hero_url.value %}
  74.         </a>
  75.     {% endif %}
  76. {% endblock %}