{% sw_extends '@Storefront/storefront/element/cms-element-page-listing.html.twig' %}
{% set imageSize = ' h-full w-full' %}
{% block element_page_listing_elongated_image_content %}
{% sw_thumbnails 'cms-image-thumbnails' with {
media: element.data.images.image_1_desktop,
attributes: {
'class': 'page-listing-img-desktop object-cover hidden lg:block rounded-sm' ~ corners ~ imageSize,
'alt': (element.data.images.image_1_desktop.alt ?: ''),
'title': (element.data.images.image_1_desktop.title ?: '')
}
} %}
<div class="ratio ratio_1x1 lg:hidden">
{% sw_thumbnails 'cms-image-thumbnails' with {
media: element.data.images.image_2_mobile,
attributes: {
'class': 'page-listing-img-mobile rounded-sm',
'alt': (element.data.images.image_2_mobile.alt ?: ''),
'title': (element.data.images.image_2_mobile.title ?: '')
}
} %}
</div>
{% endblock %}
{% block element_page_listing_default_image_content %}
<div class="ratio ratio_1x1">
{% sw_thumbnails 'cms-image-thumbnails' with {
media: element.data.images.image_1_desktop,
attributes: {
'class': 'page-listing-img w-auto object-cover rounded-sm' ~ corners ~ imageSize,
'alt': (element.data.images.image_1_desktop.alt ?: ''),
'title': (element.data.images.image_1_desktop.title ?: '')
}
} %}
</div>
{% endblock %}
{% block element_page_listing_text_content %}
<div class="{% if elongated %} absolute left-0 bottom-10 lg:pb-0 p-4 {% endif %}lg:flex lg:flex-col lg:flex-grow">
{% if title %}
<h2 class="h2 font-bold text-lg my-2 !font-display {% if elongated %}!text-white{% else %}text-black{% endif %} md:text-2xl">
{{ title }}
</h2>
{% endif %}
{% if text %}
<div class="text-sm {% if elongated %}text-white pb-4 {% else %}text-black{% endif %}">
{{ text }}
</div>
{% endif %}
{% if button.active %}
<a role="button"
class="{% if elongated %} btn-link {% else %}btn rounded-sm {{ button.type }}{% endif %} text-sm mt-2 lg:max-w-fit"
href="{{ button.url }}"
{% if button.newtab %}target="_blank"{% endif %}>
{{ button.text }}
{% if not elongated %}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
</svg>
{% endif %}
</a>
{% endif %}
</div>
{% endblock %}