{% set currentPage = ((searchResult.criteria.offset + 1) / searchResult.criteria.limit )|round(0, 'ceil') %}
{% set paginationConfig = {
page: currentPage,
parentFilterPanelSelector: '.' ~ rcpWrapper,
} %}
{% set listingPagination = {
params: params,
dataUrl: dataUrl,
filterUrl: filterUrl,
filterPanelSelector: '.recipe-filter-panel',
cmsProductListingSelector: '.cms-element-recipe-listing-' ~ rcpId,
cmsProductListingWrapperSelector: '.' ~ rcpWrapper,
activeFilterContainerSelector: '.recipe-filter-panel-active-container',
resetAllFilterButtonClasses: 'recipe-filter-reset-all btn btn-sm btn-outline-danger',
resetAllFilterButtonSelector: '.recipe-filter-reset-all',
snippets: {
resetAllButtonText: 'recipe-manager.listing.filterPanelResetAll'|trans|sw_sanitize
}
} %}
{% block recipe_listing %}
<div class="{{ rcpWrapper }}"
data-recipe-listing-pagination="true"
data-recipe-listing-pagination-options='{{ paginationConfig|json_encode }}'
data-recipe-listing="true"
data-recipe-listing-options='{{ listingPagination|json_encode }}'>
<div class="cms-element-recipe-listing-{{ rcpId }}">
{% if searchResult.total > 0 %}
<div class="cms-element-rcp-recipe-listing-actions row justify-content-between">
{% block recipe_listing_pagination %}
<div class="col-md-auto">
{% sw_include '@Storefront/rcpmanager/recipe/pagination.html.twig' with {
entities: searchResult,
criteria: searchResult.criteria
} %}
</div>
{% endblock %}
</div>
{% endif %}
{% block recipe_listing_row %}
<div class="cms-news-full-listing-row js-listing-wrapper">
{% if searchResult.total > 0 %}
{% block recipe_listing_col %}
<div class="row">
{% for item in searchResult %}
{% block recipe_listing_box %}
<div class="col-12 col-md-4 col-lg-3 my-4">
{% sw_include '@Storefront/rcpmanager/recipe/card/box.html.twig' %}
</div>
{% endblock %}
{% endfor %}
</div>
{% endblock %}
{% else %}
{% block recipe_listing_col_empty %}
<div class="cms-listing-col col-12">
{% block recipe_listing_col__empty_alert %}
{% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
type: 'info',
content: 'recipe-manager.listing.emptyResultMessage'|trans|sw_sanitize
} %}
{% endblock %}
</div>
{% endblock %}
{% endif %}
</div>
{% endblock %}
</div>
</div>
{% endblock %}