Pagerer

Configurable pager styles module providing a collection of enhanced pager styles to replace or supplement Drupal's standard pager.

pagerer
2,767 sites
46
drupal.org

Install

Drupal 11, 10 v3.1.1
composer require 'drupal/pagerer:^3.1'
Drupal 9 v8.x-2.3
composer require 'drupal/pagerer:8.x-2.3'

Overview

Pagerer is a comprehensive pager enhancement module that provides a collection of configurable pager styles to enhance Drupal and Views standard pagers. It allows administrators and site builders to preset multiple pager configurations (presets) where each preset can be made up of three panes: left, center, and right. Each pane can contain any of the available pager styles, offering extensive flexibility to satisfy complex pagination requirements.

The module can override Drupal's core pager with any preset configuration globally, or individual presets can be used within specific Views through the included Views pager plugin. Pagerer uses standard Drupal pager CSS classes, ensuring CSS styling compatibility with existing themes.

Key capabilities include: displaying page numbers, items, or item ranges; links to progressively more distant pages (like +10, +100, +1000); adaptive logic links that narrow down to target pages through binary search-like navigation; customizable text separators and breakers; support for Views AJAX-enabled pagers; and the ability to start page numbering from 1 instead of 0 in URL querystrings.

Features

  • Multi-pane pager system with left, center, and right panes that can each contain different pager styles
  • Five built-in pager styles: Standard (like Drupal core), Progressive (links to increasingly distant pages), Adaptive (binary search-like navigation), Basic (similar to Views mini pager), and Multipane (composite style)
  • Configurable preset system allowing unlimited saved pager configurations
  • Global core pager replacement - replace Drupal's standard pager site-wide with any preset
  • Views pager plugin integration - use different Pagerer presets for different Views
  • Display modes: pages, items, or item ranges with customizable text labels
  • Configurable first/previous/next/last navigation links with flexible display rules
  • URL querystring customization - use custom parameter names (e.g., 'pg' instead of 'page') and one-based page indexing
  • Support for Views AJAX-enabled pagers
  • Accessible design with screen reader support through configurable reader text
  • Full text customization through translatable tag configuration
  • Page separators and breakers with configurable display

Use Cases

Replace site-wide pager with enhanced navigation

Use Pagerer to replace Drupal's default pager on all pages with a more feature-rich alternative. Configure a preset with your desired style (e.g., Progressive for large datasets) and select it as the core pager replacement in Pagerer settings.

Different pagers for different Views

Create multiple Pagerer presets tailored to different use cases. For a product catalog with thousands of items, use Progressive style with links to +10, +100 pages. For a blog archive, use Basic style. Assign each preset to the appropriate View.

SEO-friendly one-based page URLs

Configure URL settings to use one-based page indexing (pg=1 instead of page=0) for more user-friendly and SEO-friendly URLs. Also customize the parameter name from 'page' to 'pg' for cleaner URLs.

Multi-pane pager with navigation and info

Create a preset with Basic style in the left pane (showing previous/first navigation), Standard style in the center (showing page numbers), and Basic style in the right pane (showing next/last navigation plus item count). This provides comprehensive navigation information.

Large dataset navigation with Adaptive style

For very large datasets where users need to find a specific page quickly, use the Adaptive style. It uses a binary-search approach where clicking on adaptive links progressively narrows the range until the target page is reached.

Display items instead of pages

Configure a pager to show 'Items 1-50 of 5000' instead of 'Page 1 of 100' by setting the display option to 'items' or 'item_ranges'. This is useful when the focus is on the content count rather than page numbers.

Tips

  • Use the example module (pagerer_example) to see live demonstrations of all pager styles at /pagerer/example
  • The Progressive style with factors '10' creates links at +10, +100, +1000 page intervals - useful for very large datasets
  • Adaptive style is ideal when users need to find a specific page in a large dataset but don't know the exact page number
  • When customizing text labels, use placeholders like @number, @total, @item_low, @item_high, @total_items for dynamic values
  • Each pane can have a different display mode - show pages in the center but item counts in the side panes
  • For accessibility, configure reader_text values to provide meaningful descriptions for screen reader users

Technical Details

Admin Pages 5
Pagerer /admin/config/user-interface/pagerer

Main Pagerer configuration page that lists all created pager presets with live previews, and allows selecting a preset to replace Drupal's core pager globally.

Pagerer URL settings /admin/config/user-interface/pagerer/url_settings

Configure URL querystring parameter settings to override Drupal's standard 'page' parameter with a custom format.

Add pager /admin/config/user-interface/pagerer/preset/add

Create a new Pagerer preset configuration.

Edit pager /admin/config/user-interface/pagerer/preset/manage/{pagerer_preset}

Configure the three panes (left, center, right) of a Pagerer preset by selecting a style for each pane. Includes live preview of the configured pager.

Pane settings /admin/config/user-interface/pagerer/preset/manage/{pagerer_preset}/pane/{pane}

Detailed configuration form for a specific pane's style settings including display options, link behavior, separators, and text strings.

Hooks 2
hook_pagerer_style_plugin_info_alter

Allows modules to alter the Pagerer style plugin definitions

hook_element_info_alter

Pagerer uses this hook to replace the core pager element's theme with the pagerer theme when configured to override core pager

Troubleshooting 4
Pager styles not appearing correctly

Clear all caches after changing Pagerer settings. The module hooks into the render element system which is cached.

URL parameters not changing after enabling URL override

Ensure you've enabled the 'URL querystring' checkbox in URL settings and saved the configuration. Clear caches afterward.

Custom preset not showing in Views

The preset must be created and saved before it appears in the Views pager configuration. Create the preset first in Pagerer admin, then configure the View.

Pager not displaying at all

Check the 'Restriction' setting on the pane configuration. If set to 'at least two pages' and there's only one page of results, the pager won't display.