Score:0

Hide/remove "Last" label/icon in views pager

cn flag
lee

I don't want my user to click the "Last" label on the views pager, but I can't find a way to remove this "Last" label even I leave the "Last page link text" field empty, I don't want to use the mini pager, so in the full pager, how can we remove the "Last" label/icon ? Thanks

Score:3
de flag

You can override pager.html.twig in your theme, removing the section that adds the 'last' link:

{% if items.last %}
  <li class="pager__item pager__item--last">
    <a href="{{ items.last.href }}" title="{{ 'Go to last page'|t }}"{{ items.last.attributes|without('href', 'title') }}>
      <span class="visually-hidden">{{ 'Last page'|t }}</span>
      <span aria-hidden="true">{{ items.last.text|default('Last »'|t) }}</span>
    </a>
  </li>
{% endif %}

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.