Pagers
Pagers are configured on the views configuration page:
Figure 8.10 – Pager configuration
In this case, the theme hook is pager
, and its suggestions are the following:
pager
--
trips
--
all
.html.twig
pager
--
all
.html.twig
pager
--
trips
--
page
.html.twig
pager
-
-
page
.html.twig
pager
--
trips
.html.twig
pager
.html.twig
The pager
theme hook is not used only on views; it’s a standard component that Drupal uses every time it needs to render a pagination widget. We can find the default implementation in the templates/navigation/pager.html.twig
file. Replace the content with the following:
{{ include('@atoms/pager.html.twig', { 'headingId': heading_id, 'items': items, 'current': current, 'ellipses': ellipses, }) }}
Clear the cache, refresh the /trips
page, and now the Trips view is completely styled.