{% block element_subcategories %}
{% set config = element.fieldConfig.elements %}
{% if element.data.elements|filter(v => v.type != 'folder')|length > 0 %}
<div class="cms-element-subcategories" style="height: 100%; width: 100%">
<ul class="row">
{% for subcategory in element.data.elements|filter(v => v.type != 'folder') %}
{% set link = category_url(subcategory) %}
{% if not subcategory.translated.customFields.migration_kewsw5_category_hide_in_navigation and subcategory.active and subcategory.visible %}
<li class="col-md-4 col-6">
<a href="{{ link }}" {% if category_linknewtab(subcategory) %} target="_blank" {% if subcategory.linkType == "external" %} rel="noopener noreferrer" {% endif %} {% endif %}>
<div class="cat-img">
{% if subcategory.media %}
{% sw_thumbnails 'moorl-listing-item-image-thumbnails' with {
media: subcategory.media,
attributes: {
'itemprop': 'image',
'alt': title,
'class': "is-#{config.displayMode.value}",
'style': imageCss|join(';'),
'title': ''
}
} %}
{% else %}
<div class="product-image-placeholder">
{% sw_icon 'placeholder' style {
'size': 'fluid'
} %}
</div>
{% endif %}
</div>
<div class="cat-title">
{{subcategory.name}}
</div>
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %}