vendor/mrpix/shopping-city/src/Resources/views/storefront/component/load-more.html.twig line 1

Open in your IDE?
  1. {% block component_load_more_nav %}
  2.     {% set currentPage = app.request.query.get('p')|round(0, 'ceil') %}
  3.     {% set totalEntities = total ? total : entities.total %}
  4.     {% set totalPages = (totalEntities / limit)|round(0, 'ceil') %}
  5.     {% set paginationSuffix = '' %}
  6.     {# @deprecated tag:v6.5.0 - pagination template will append `paginationSuffix` for input and label ids to avoid duplicate ids. #}
  7.     {% if feature('v6.5.0.0') and paginationLocation %}
  8.         {% set paginationSuffix = '-' ~ paginationLocation %}
  9.     {% endif %}
  10.     {% if totalPages > 1 %}
  11.         <nav aria-label="pagination" class="pagination-nav load-more-nav">
  12.             {% block component_load_more %}
  13.                 <ul class="pagination">
  14.                     {% if currentPage < totalPages %}
  15.                         {% set page = currentPage + 1 %}
  16.                     {% else %}
  17.                         {% set page = currentPage - 1 %}
  18.                     {% endif %}
  19.                     {% block component_load_more_btn %}
  20.                         <li class="page-item{% if isActive %} active{% endif %}">
  21.                             {% block component_load_more_item_input %}
  22.                                 <input type="radio"
  23.                                        name="p"
  24.                                        id="p{{ page }}{{ paginationSuffix }}"
  25.                                        value="{{ page }}"
  26.                                        class="d-none"
  27.                                        title="load-more"
  28.                                        {% if isActive %}checked="checked"{% endif %}>
  29.                             {% endblock %}
  30.                             {% block component_load_more_item_label %}
  31.                                 <label class="page-link"
  32.                                        for="p{{ page }}{{ paginationSuffix }}">
  33.                                     {% block component_load_more_item_link %}
  34.                                         {% block component_load_more_item_text %}
  35.                                             {% if currentPage < totalPages %}
  36.                                                 {{ 'mrpixShoppingCity.listing.loadMoreBtn'|trans|sw_sanitize }}
  37.                                             {% else %}
  38.                                                 {{ 'mrpixShoppingCity.listing.showLessBtn'|trans|sw_sanitize }}
  39.                                             {% endif %}
  40.                                         {% endblock %}
  41.                                     {% endblock %}
  42.                                 </label>
  43.                             {% endblock %}
  44.                         </li>
  45.                     {% endblock %}
  46.                 </ul>
  47.             {% endblock %}
  48.         </nav>
  49.     {% endif %}
  50. {% endblock %}