{% block element_blog_listing %}
{% set blogPosts = element.data.posts %}
{% set blogCategoryId = element.data.categoryId %}
{% set listingColumns = 'col-sm-6 col-lg-4 col-xl-3' %}
{% if element.translated.config.boxLayout.value == 'image' %}
{% set listingColumns = 'col-sm-6 col-lg-4 col-xl-4' %}
{% endif %}
{% if section and section.type == 'sidebar' %}
{% set listingColumns = 'col-sm-6 col-lg-6 col-xl-4' %}
{% if element.translated.config.boxLayout.value == 'image' %}
{% set listingColumns = 'col-sm-6 col-lg-6 col-xl-6' %}
{% endif %}
{% endif %}
{% set slot = page.cmsPage.firstElementOfType('blog-listing') %}
{% set filterUrl = null %}
{% set dataUrl = null %}
{% if blogCategoryId %}
{% set filterUrl = url('frontend.cms.navigation.filter', { navigationId: blogCategoryId}) %}
{% set dataUrl = url('frontend.cms.navigation.page', { navigationId: blogCategoryId }) %}
{% endif %}
{% set sidebar = sectionType == 'sidebar' %}
{% set params = { slots: slot.id, 'no-aggregations': 1 } %}
{% block element_blog_listing_wrapper %}
{% sw_include '@Storefront/storefront/component/blog/listing.html.twig' with {
blogPosts: blogPosts,
blogCategoryId: blogCategoryId,
dataUrl: dataUrl,
filterUrl: filterUrl,
params: params,
sidebar: sidebar,
boxLayout: element.translated.config.boxLayout.value,
listingColumns: listingColumns
} %}
{% endblock %}
{% endblock %}