{% block element_subcategories %} {% set config = element.fieldConfig.elements %} <div class="cms-element-subcategories" style="height: 100%; width: 100%"> <ul class="row"> {% for subcategory in element.data.elements %} <li class="col-md-3 col-6"> {% if subcategory.type=='link' %} {% if subcategory.linkType=='category' %} <a href="{{ seoUrl('frontend.navigation.page', {navigationId: subcategory.internalLink}) }}"> {% elseif subcategory.linkType=='external' %} <a href="{{ subcategory.externalLink}}"> {% endif %} {% else %} <a href="{{ seoUrl('frontend.navigation.page', {navigationId: subcategory.id}) }}"> {% endif %} <div class="cat-img"> {% if subcategory.linkType=='category' %} {% set TargetCategory = getCategoryByID(subcategory.internalLink, context.context) %} {% if TargetCategory.media %} {% sw_thumbnails 'moorl-listing-item-image-thumbnails' with { media: TargetCategory.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 %} {% else %} {% 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 %} {% endif %} </div> <div class="cat-title"> {% set name = subcategory.translated.name %} {% for translation in subcategory.translations %} {% if translation.languageId==context.salesChannel.languageId and translation.name !='' %} {% set name = translation.name %} {% endif %} {% endfor %} {{name}} </div> </a> </li> {% endfor %} </ul> </div> {% endblock %}