templates/components/image-text-section.html.twig line 1

Open in your IDE?
  1. {% set linkIsDefined = link is defined %}
  2. {% set buttonIsDefined = button is defined %}
  3. {% set externalLinkDefined = externalLink is defined and externalLink %}
  4. <div class="image-text-section mt-3 mb-5 my-md-3 {{ backgroundColorClass ?? '' }}">
  5.     <div class="container py-3 py-md-5">
  6.         <div class="row gx-0 gx-lg-5">
  7.             <div class="col-12 col-lg-6 order-2 order-lg-{{ order.text ?? '1' }}">
  8.                 {% if (link.enabled|default(false)) %}
  9.                 <div class="d-flex flex-column justify-content-between h-100">
  10.                 {% endif %}
  11.                 <div>
  12.                     {% if (title is defined) %}
  13.                     <h2 class="mb-3 mb-md-5 point {{ darkPoint|default(false) ? 'dark' : 'light' }}">{{ title }}</h2>
  14.                     {% endif %}
  15.                     <div class="mb-4 {{ title is not defined ? 'teaser-text' : '' }}">{{ text|raw }}</div>
  16.                 </div>
  17.                 {% if (buttonIsDefined) %}
  18.                     {% if (button.withIcon is defined and button.withIcon) %}
  19.                         {{ include('@components/button-with-icon.html.twig', {
  20.                             text: button.text,
  21.                             link: {
  22.                                 href: button.link,
  23.                                 external: externalLinkDefined
  24.                             },
  25.                             order: {
  26.                                 text: button.order.text|default('1'),
  27.                                 icon: button.order.icon|default('2')
  28.                             }
  29.                         }) }}
  30.                     {% else %}
  31.                         {{ include('@components/button.html.twig', {
  32.                             text: button.text,
  33.                             link: {
  34.                                 href: button.link|default('#')
  35.                             },
  36.                         }) }}
  37.                     {% endif %}
  38.                 {% endif %}
  39.                 {% if (linkIsDefined) %}
  40.                     {{ include('@components/link.html.twig', {
  41.                         link: link.link|default('#'),
  42.                         text: link.text|default('')
  43.                     }) }}
  44.                 {% endif %}
  45.                 {% if (link.enabled|default(false)) %}
  46.                 </div>
  47.                 {% endif %}
  48.             </div>
  49.             <div class="col-12 col-lg-6 mb-4 mb-lg-0 order-1 order-lg-{{ order.image ?? '2' }}">
  50.             {% if (imageIsIcon is defined and imageIsIcon) %}
  51.                 {% if image is defined and image %}
  52.                     <img style="width: 14rem; height: 14rem;" class="d-block mx-auto" src="{{ image }}" alt="">
  53.                 {% endif %}
  54.             {% elseif (imageAsBackground is defined and imageAsBackground) %}
  55.                 <div class="ratio ratio16x9 position-relative" style="height: 20rem">
  56.                     <div class="image position-absolute w-100 h-100 top-0" style="background-image: url('{{image}}'); background-size: cover; background-position: center; background-repeat: no-repeat"></div>
  57.                 </div>
  58.             {% else %}
  59.                 {% if image %}
  60.                     <img class="d-block w-100" src="{{ image }}" alt="">
  61.                 {% endif %}
  62.             {% endif %}
  63.             </div>
  64.         </div>
  65.     </div>
  66. </div>