{% block block_category %}
<div class="cms-element-categories-slider">
{% for slot in block.slots %}
{% if slot.type == "categories-head" %}
{% block block_categories_head %}
{% set element = block.slots.getSlot(slot.slot) %}
{% sw_include "@Storefront/storefront/element/cms-element-categories-head.html.twig" with {
isSlider: true,
} %}
{% endblock %}
{% endif %}
{% endfor %}
<div class="categories-slider">
{% for slot in block.slots %}
{% if slot.type == "category-slider" %}
{% block block_categories_slider %}
{% set element = block.slots.getSlot(slot.slot) %}
{% sw_include "@Storefront/storefront/element/cms-element-category-slider.html.twig" %}
{% endblock %}
{% endif %}
{% endfor %}
</div>
<div class="cms-element-categories">
{% set iconMediaIds = [] %}
{% set slots = block.slots|category_check_property|sort((a, b) => a.slot|slice(5,length)|number_format <=> b.slot|slice(5,length)|number_format) %}
{% for slot in slots %}
{% if slot.data[0].customFields.custom_category_icon_icon %}
{% set iconMediaId = slot.data[0].customFields.custom_category_icon_icon %}
{% set iconMediaIds = iconMediaIds|merge([iconMediaId]) %}
{% endif %}
{% endfor %}
{% set mediaCollection = searchMedia(iconMediaIds, context.context) %}
{% for slot in slots %}
{% if slot.data[0].customFields.custom_category_icon_icon %}
{% set icon = slot.data[0].customFields.custom_category_icon_icon %}
{% set iconMedia = mediaCollection.get(icon) %}
{% endif %}
{% block block_category_item %}
{% set element = block.slots.getSlot(slot.slot) %}
<a class="cms-element-categories-small-item" href="{{ slot.data[0].customFields.custom_category_menu_banner_url }}">
{% if iconMedia %}
{% sw_thumbnails 'my-thumbnails' with {
media: iconMedia,
attributes: {
'class': 'category-button-icon',
'title': element.data.all[0].translated.name
}
} %}
{% endif %}
{{ element.data.all[0].translated.name }}
</a>
{% endblock %}
{% set icon = null %}
{% set iconMedia = null %}
{% endfor %}
</div>
</div>
{% endblock %}