custom/static-plugins/NdTheme/src/Resources/views/storefront/element/cms-element-page-listing.html.twig line 1

Open in your IDE?
  1. {% block element_page_listing %}
  2.     {% set elongated = element.config.background.value %}
  3.     {% set title = element.config.title.value %}
  4.     {% set text = element.config.text.value %}
  5.     {% set button = element.config.button.value %}
  6.     {% set imageSize = ' h-full' %}
  7.     {% if element.config.borders.value.left and element.config.borders.value.right %}
  8.         {% set corners = ' rounded-t-[272px] ' %}
  9.     {% elseif element.config.borders.value.left %}
  10.         {% set corners = ' rounded-tl-[272px] ' %}
  11.     {% elseif element.config.borders.value.right %}
  12.         {% set corners = ' rounded-tr-[272px] ' %}
  13.     {% endif %}
  14.     <article data-element="{{ element.type }}" class="listing-area listing-area-{{ element.slot }} relative {% if not elongated %}lg:flex lg:flex-col{% endif %}">
  15.         {% if elongated %}
  16.             {% block element_page_listing_elongated_image_content %}
  17.                 {% sw_thumbnails 'cms-image-thumbnails' with {
  18.                     media: element.data.images.image_1_desktop,
  19.                     attributes: {
  20.                         'class': 'page-listing-img-desktop object-cover hidden lg:block' ~ corners ~ imageSize,
  21.                         'alt': (element.data.images.image_1_desktop.alt ?: ''),
  22.                         'title': (element.data.images.image_1_desktop.title ?: '')
  23.                     }
  24.                 } %}
  25.                 <div class="ratio ratio_1x1 lg:hidden">
  26.                     {% sw_thumbnails 'cms-image-thumbnails' with {
  27.                         media: element.data.images.image_2_mobile,
  28.                         attributes: {
  29.                             'class': 'page-listing-img-mobile',
  30.                             'alt': (element.data.images.image_2_mobile.alt ?: ''),
  31.                             'title': (element.data.images.image_2_mobile.title ?: '')
  32.                         }
  33.                     } %}
  34.                 </div>
  35.             {% endblock %}
  36.         {% elseif not elongated %}
  37.             {% block element_page_listing_default_image_content %}
  38.                 <div class="ratio {% if block.type == 'triple-page-listing' %}ratio_1x1{% else %}ratio_3x4{% endif %}">
  39.                     {% sw_thumbnails 'cms-image-thumbnails' with {
  40.                         media: element.data.images.image_1_desktop,
  41.                         attributes: {
  42.                             'class': 'page-listing-img w-auto object-cover' ~ corners ~ imageSize,
  43.                             'alt': (element.data.images.image_1_desktop.alt ?: ''),
  44.                             'title': (element.data.images.image_1_desktop.title ?: '')
  45.                         }
  46.                     } %}
  47.                 </div>
  48.             {% endblock %}
  49.         {% endif %}
  50.         {% block element_page_listing_text_content %}
  51.             <div class="{% if elongated %}-translate-y-full px-3 pb-3 w-full lg:absolute lg:left-1/2 lg:-translate-x-1/2 lg:bottom-10 lg:pb-0 lg:px-10 lg:translate-y-0 {% else %}mt-10 lg:flex lg:flex-col lg:flex-grow{% endif %}">
  52.                 {% if title %}
  53.                     <h2 class="h2 font-light {% if elongated %}text-white{% else %}text-black{% endif %}">
  54.                         {{ title }}
  55.                     </h2>
  56.                 {% endif %}
  57.                 {% if text %}
  58.                     <div class="font-light text-base {% if elongated %}text-white{% else %}text-black mt-4 lg:mb-10{% endif %}">
  59.                         {{ text }}
  60.                     </div>
  61.                 {% endif %}
  62.                 {% if button.active %}
  63.                     <a role="button"
  64.                        class="{% if elongated %} btn-link mt-4 text-white text-xs md:text-base{% else %}btn mt-10 lg:mt-auto {{ button.type }}{% endif %}"
  65.                        href="{{ button.url }}"
  66.                        {% if button.newtab %}target="_blank"{% endif %}>
  67.                         {{ button.text }}
  68.                     </a>
  69.                 {% endif %}
  70.             </div>
  71.         {% endblock %}
  72.     </article>
  73. {% endblock %}