xbase-2.x-dev/templates/overridden/pager.html.twig

templates/overridden/pager.html.twig
{% if items %}
  <nav class="pager">
    <ul class="pager__items js-pager__items">

      {# First #}
      {% if items.first %}
        <li class="pager__item pager__item--first">
          <a class="pager__link" href="{{ items.first.href }}" title="{{ 'First page'|t }}"{{ items.first.attributes|without('href', 'title') }}>
            <span>{{ items.first.text|default('« First'|t) }}</span>
          </a>
        </li>
      {% endif %}

      {# Previous #}
      {% if items.previous %}
        <li class="pager__item pager__item--previous">
          <a class="pager__link" href="{{ items.previous.href }}" title="{{ 'Previous page'|t }}" rel="prev"{{ items.previous.attributes|without('href', 'rel', 'title') }}>
            <span>{{ items.previous.text|default('‹ Previous'|t) }}</span>
          </a>
        </li>
      {% endif %}

      {# Ellipsis #}
      {% if ellipses.previous %}
        <li class="pager__item pager__item--ellipsis" role="presentation">&hellip;</li>
      {% endif %}

      {# Pages #}
      {% for key, item in items.pages %}
        <li class="pager__item{{ current == key ? ' pager__item--active' : '' }}">
          <a class="pager__link" href="{{ item.href }}"{{ item.attributes|without('href') }}>
            {{- key -}}
          </a>
        </li>
      {% endfor %}

      {# Ellipsis #}
      {% if ellipses.next %}
        <li class="pager__item pager__item--ellipsis" role="presentation">&hellip;</li>
      {% endif %}

      {# Next #}
      {% if items.next %}
        <li class="pager__item pager__item--next">
          <a class="pager__link" href="{{ items.next.href }}" title="{{ 'Next page'|t }}" rel="next"{{ items.next.attributes|without('href', 'rel') }}>
            <span>{{ items.next.text|default('Next ›'|t) }}</span>
          </a>
        </li>
      {% endif %}

      {# Last #}
      {% if items.last %}
        <li class="pager__item pager__item--last">
          <a class="pager__link" href="{{ items.last.href }}" title="{{ 'Last page'|t }}"{{ items.last.attributes|without('href') }}>
            <span>{{ items.last.text|default('Last »'|t) }}</span>
          </a>
        </li>
      {% endif %}

    </ul>
  </nav>
{% endif %}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc