custom/plugins/SasBlogModule/src/Resources/views/storefront/component/blog/listing.html.twig line 1

Open in your IDE?
  1. {% set currentPage = ((searchResult.criteria.offset + 1) / searchResult.criteria.limit )|round(0, 'ceil') %}
  2. {% set paginationConfig = { page: currentPage }|json_encode %}
  3. {% set listingPagination = {
  4.     params: params,
  5.     dataUrl: dataUrl,
  6.     filterUrl: filterUrl,
  7.     snippets: {
  8.         resetAllButtonText: 'sas-blog.listing.filterPanelResetAll'|trans|sw_sanitize
  9.     }
  10. } %}
  11. {% block sas_blog_listing %}
  12.     <div class="cms-element-product-listing-wrapper"
  13.          data-listing-pagination="true"
  14.          data-listing-pagination-options='{{ paginationConfig }}'
  15.          data-listing="true"
  16.          data-listing-options='{{ listingPagination|json_encode }}'>
  17.         <div class="cms-element-product-listing">
  18.             {% if searchResult.total > 0 %}
  19.                 <div class="cms-element-sas-blog-listing-actions row justify-content-between">
  20.                     {% block sas_block_pagination %}
  21.                         <div class="col-md-auto">
  22.                             {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  23.                                 entities: searchResult,
  24.                                 criteria: searchResult.criteria
  25.                             } %}
  26.                         </div>
  27.                     {% endblock %}
  28.                 </div>
  29.             {% endif %}
  30.             {% block sas_element_blog_listing_row %}
  31.                 <div class="cms-news-full-listing-row js-listing-wrapper">
  32.                     {% if searchResult.total > 0 %}
  33.                         {% block sas_element_blog_listing_col %}
  34.                             <div class="row">
  35.                                 {% for article in searchResult %}
  36.                                     {% block sas_element_blog_listing_box %}
  37.                                         <div class="col-12 col-md-4 col-lg-3 my-4">
  38.                                             {% sw_include '@Storefront/storefront/component/blog/card/box.html.twig' %}
  39.                                         </div>
  40.                                     {% endblock %}
  41.                                 {% endfor %}
  42.                             </div>
  43.                         {% endblock %}
  44.                     {% else %}
  45.                         {% block sas_element_blog_listing_col_empty %}
  46.                             <div class="cms-listing-col col-12">
  47.                                 {% block sas_element_blog_listing_col_empty_alert %}
  48.                                     {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  49.                                         type: 'info',
  50.                                         content: 'sas-blog.search.emptyResult'|trans|sw_sanitize
  51.                                     } %}
  52.                                 {% endblock %}
  53.                             </div>
  54.                         {% endblock %}
  55.                     {% endif %}
  56.                 </div>
  57.             {% endblock %}
  58.         </div>
  59.     </div>
  60. {% endblock %}