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

Open in your IDE?
  1. {% sw_extends '@SasBlogModule/storefront/component/blog/listing.html.twig' %}
  2. {% set currentPage = ((searchResult.criteria.offset + 1) / searchResult.criteria.limit )|round(0, 'ceil') %}
  3. {% set paginationConfig = { page: currentPage }|json_encode %}
  4. {% set listingPagination = {
  5.     params: params,
  6.     dataUrl: dataUrl,
  7.     filterUrl: filterUrl,
  8.     snippets: {
  9.         resetAllButtonText: 'sas-blog.listing.filterPanelResetAll'|trans|sw_sanitize
  10.     }
  11. } %}
  12. {% block sas_blog_listing %}
  13.     <div class="cms-element-product-listing-wrapper"
  14.          data-listing-pagination="true"
  15.          data-listing-pagination-options='{{ paginationConfig }}'
  16.          data-listing="true"
  17.          data-listing-options='{{ listingPagination|json_encode }}'>
  18.         <div class="cms-element-product-listing">
  19.             {% if searchResult.total > 0 %}
  20.                 <div class="cms-element-sas-blog-listing-actions row justify-content-between">
  21.                     {% block sas_block_pagination %}
  22.                         <div class="col-md-auto">
  23.                             {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  24.                                 entities: searchResult,
  25.                                 criteria: searchResult.criteria
  26.                             } %}
  27.                         </div>
  28.                     {% endblock %}
  29.                 </div>
  30.             {% endif %}
  31.             {% block sas_element_blog_listing_row %}
  32.             <div class="blog_listing js-listing-wrapper">
  33.                     <h1 class="page_title">HYBUYS BLOG</h1>
  34.                     {% if searchResult.total > 0 %}
  35.                         {% block sas_element_blog_listing_col %}
  36.                             <div class="listing_inner">
  37.                                 {% for article in searchResult %}
  38.                                     {% block sas_element_blog_listing_box %}
  39.                                         <div class="news_block">
  40.                                             {% sw_include '@Storefront/storefront/component/blog/card/box.html.twig' %}
  41.                                         </div>
  42.                                     {% endblock %}
  43.                                 {% endfor %}
  44.                             </div>
  45.                             <div class="actions_sidebar">
  46. {#                                <form class="blog_search">#}
  47. {#                                    <label>#}
  48. {#                                        <span class="label">blog search</span>#}
  49. {#                                        <input name="blog_search" placeholder="Search Blog"/>#}
  50. {#                                    </label>#}
  51. {#                                    <button type="submit" aria-label="blog search" class="icon_search"></button>#}
  52. {#                                </form>#}
  53.                                 <div class="topics_list">
  54.                                     <div class="list_title">Topics</div>
  55.                                     <ul>
  56.                                         <li><a href="/Blog/"
  57.                                                 {% if app.request.attributes.get('sw-original-request-uri') == '/Blog/' %}
  58.                                                class="current"
  59.                                                {% endif %}
  60.                                             >All Topcs</a></li>
  61.                                         {% if config.showCategoryFilter.value or config.showAuthorFilter.value %}
  62.                                             {% set blogCategories = searchResult.aggregations.get('blogCategories') %}
  63.                                             {% if not blogCategories.entities is empty %}
  64.                                                 {% set blogCategoriesSorted = blogCategories.entities|sort((a, b) => a.translated.name|lower > b.translated.name|lower) %}
  65. {#                                                {{ dump(blogCategoriesSorted) }}#}
  66.                                                 {% for category in blogCategoriesSorted %}
  67.                                                     <li>
  68.                                                         <a
  69.                                                             href="/blog/?categories={{ category.id }}&p=1"
  70.                                                             {% if app.request.get('categories') == category.id %}
  71.                                                             class="current"
  72.                                                             {% endif %}
  73.                                                         >{{ category.translated.name }}
  74.                                                         </a>
  75.                                                     </li>
  76.                                                 {% endfor %}
  77.                                             {% endif %}
  78.                                         {% endif %}
  79.                                     </ul>
  80.                                 </div>
  81.                             </div>
  82.                         {% endblock %}
  83.                     {% else %}
  84.                         {% block sas_element_blog_listing_col_empty %}
  85.                             <div class="cms-listing-col col-12">
  86.                                 {% block sas_element_blog_listing_col_empty_alert %}
  87.                                     {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  88.                                         type: 'info',
  89.                                         content: 'sas-blog.search.emptyResult'|trans|sw_sanitize
  90.                                     } %}
  91.                                 {% endblock %}
  92.                             </div>
  93.                         {% endblock %}
  94.                     {% endif %}
  95.                 </div>
  96.             {% endblock %}
  97.         </div>
  98.     </div>
  99. {% endblock %}