{% set currentPage = ((searchResult.criteria.offset + 1) / searchResult.criteria.limit )|round(0, 'ceil') %}
{% set paginationConfig = { page: currentPage }|json_encode %}
{% set listingPagination = {
sidebar: sidebar,
params: params,
dataUrl: dataUrl,
filterUrl: filterUrl,
snippets: {
resetAllButtonText: 'listing.filterPanelResetAll'|trans|sw_sanitize
}
} %}
{% block h1webblog_listing %}
<div class="cms-element-product-listing-wrapper"
data-listing-pagination="true"
data-listing-pagination-options='{{ paginationConfig }}'
data-listing="true"
data-listing-options='{{ listingPagination|json_encode }}'>
{% block element_h1webblog_listing_wrapper_content %}
<div {% if page.cmsPage.type != 'product_list' %}class="cms-element-product-listing"{% endif %}>
{% block element_h1webblog_listing_row %}
<div class="row cms-listing-row js-listing-wrapper{% if (justifyContent) %} {{ justifyContent }}{% endif %}">
{% if searchResult.total > 0 %}
{% block element_h1webblog_listing_col %}
{% for blog in searchResult %}
<div class="cms-listing-col {{ listingColumns }} mb-5">
{% block element_h1webblog_listing_box %}
{% sw_include '@Storefront/storefront/component/h1webblog/card/box.html.twig' %}
{% endblock %}
</div>
{% endfor %}
{% endblock %}
{% else %}
{% block element_h1webblog_listing_col_empty %}
<div class="cms-listing-col col-12">
{% block element_h1webblog_listing_col_empty_alert %}
{% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
type: 'info',
content: 'listing.emptyResultMessage'|trans|sw_sanitize
} %}
{% endblock %}
</div>
{% endblock %}
{% endif %}
</div>
{% endblock %}
{% if searchResult.total > searchResult.limit %}
{% block element_h1webblog_listing_pagination_nav_bottom %}
{% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
entities: searchResult,
criteria: searchResult.criteria
} %}
{% endblock %}
{% endif %}
</div>
{% endblock %}
</div>
{% endblock %}