Dropdown Pager (1.0.x branch) provides an accessible, compact pagination interface for Drupal Views. Instead of the default full pager links, it offers a dropdown‑based pager control that displays the current page and lets users quickly select a page from a list, helping save space and improve usability on content‑rich listings.

This module integrates directly with Views and works with Views paged output, replacing the standard pager with a dropdown interface that maintains all core pager functionality — including navigation to First, Previous, Next, and Last pages. The dropdown can include an optional quick search field for jumping to specific page numbers, and all markup is fully themeable via Drupal’s templating system.

The module is built with accessibility in mind, including WCAG‑friendly ARIA labels and keyboard navigation support, making it suitable for a wide range of sites that need improved pager UX without custom code.

I have primarily contributed to the 1.0.x branch and am committed to supporting ongoing maintenance, bug fixes, issue reviews, and community assistance for this module.

Project link

https://www.drupal.org/project/dropdown_pager

CommentFileSizeAuthor
Screenshot from 2026-02-13 13-11-26.png12.12 KBmarounmt

Comments

marounmt created an issue. See original summary.

avpaderno’s picture

Thank you for applying!

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

The important notes are the following.

  • If you have not done it yet, you should enable GitLab CI for the project and fix the PHP_CodeSniffer errors/warnings it reports.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status will not be changed by this application; once this application is closed, you will be able to change the project status from Not covered to Opt into security advisory coverage. This is possible only 14 days after the project is created.

    Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
  • Only the person who created the application will get the permission to opt projects into security advisory coverage. No other person will get the same permission from the same application; that applies also to co-maintainers/maintainers of the project used for the application.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a project moderator before posting the first comment on newly created applications. Project moderators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

vishal.kadam’s picture

Status: Needs review » Reviewed & tested by the community

I have reviewed the code, and it looks good to me.

Please wait for a Project Moderator to take a look and if everything goes fine, you will get the role.

avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
  • The following points are just a start and don't necessarily encompass all of the changes that may be necessary
  • A specific point may just be an example and may apply in other places
  • A review is about code that doesn't follow the coding standards, contains possible security issue, or does not correctly use the Drupal API; the single points are not ordered, not even by importance

dropdown_pager.module

A new module that aims to be compatible with latest Drupal releases is expected to implement hooks as class methods as described in Support for object oriented hook implementations using autowired services.
It requires increasing the minimum required Drupal version, but that is not an issue, since not all the Drupal releases are supported.

src/Hook/DropdownPagerHook.php

Since the class is final, the class properties can only be private, since the class cannot be extended, and protected means The property can be accessed by a child class, but it is private outside the class.

  private function replacePlaceholders(string $template, array $replacements): string {
    // Only replace placeholders that exist in the template.
    $found_placeholders = [];
    foreach ($replacements as $placeholder => $value) {
      if (strpos($template, $placeholder) !== FALSE) {
        $found_placeholders[$placeholder] = $value;
      }
    }
    return str_replace(array_keys($found_placeholders), array_values($found_placeholders), $template);
  }

Replacing placeholder values in a string can be done with FormattableMarkup , which can be used similarly to what the following code does.

    $site_name = $site_config->get('name');
    $challenge = new FormattableMarkup('Basic realm="@realm"', [
      '@realm' => !empty($site_name) ? $site_name : 'Access restricted',
    ]);

src/Plugin/views/pager/Dropdown.php

Projects that are compatible with Drupal 10 or higher versions should use attributes instead of annotations. This means requiring at least Drupal 10.3, but this is not an issue, considering that the minimum supported Drupal version.

marounmt’s picture

Status: Needs work » Needs review

Hello, thank you for the review. I’ve applied the suggested changes here: switched to attributes instead of annotations, updated the core requirement to 10.3+, fixed the class property visibility, and replaced the placeholder logic with FormattableMarkup.

The hooks are already implemented as class methods; the .module file is retained only for backward compatibility with Drupal 10.3 and 11.0.

Could you please review and verify?

oivanov’s picture

Status: Needs review » Needs work

I reviewed the 1.0.x branch of dropdown_pager.

### Previous reviewer issues (avpaderno)

All three have been addressed:
1. Annotations converted to PHP 8.1 attributes -- correct.
2. `protected` changed to `private` on the final class property -- correct.
3. Custom `replacePlaceholders()` replaced with `FormattableMarkup` -- correct, all 7 occurrences updated.

### Security

No security issues found. The module uses `FormattableMarkup` with `@` placeholders for proper HTML escaping, generates URLs through `Url::fromRoute()`, has no raw Twig output, no direct database queries, no debug code, and no bundled third-party libraries.

### Issues found (minor)

1. `dropdown_pager.module` line 26: Docblock says `hook_template_preprocess_views_dropdown_pager()` -- should be `template_preprocess_views_dropdown_pager()` (not a hook).

2. `composer.json`: Missing `"license": "GPL-2.0-or-later"` field.

3. `src/Plugin/views/pager/Dropdown.php` lines 78, 109: `'#input' => TRUE` on `details` form elements is unnecessary. The `#input` flag is meant for actual input elements; `#tree => TRUE` alone handles the nesting.

4. `css/dropdown-pager.css` lines 157-164 and 175-181: Duplicate CSS rule for `.pager__dropdown-item--ellipsis`. The second declaration overrides the first. Should be consolidated into one rule.

These are all quick fixes. The module is well-written with good accessibility support and proper Drupal API usage throughout. Setting to **Needs work** for the items above.

bbu23’s picture

@oivanov since u are using AI to help drafting your feedback, u could at least make an effort to format the output from Markdown to html or plain text so that people can easily read it...

oivanov’s picture

me personally - I prefer Markdown to everything else, so I make an effort not to have to deal with HTML (definitely) or plain text (when I can).
If markdown is not acceptable - we can add that to the guidance. Let me know if you want me to do that

marounmt’s picture

Status: Needs work » Needs review

Hello,

I’ve addressed the points mentioned:
– Fixed the incorrect docblock for template_preprocess_views_dropdown_pager()
– Added the "license": "GPL-2.0-or-later" field to composer.json
– Removed the unnecessary #input => TRUE from the details elements
– Consolidated the duplicate .pager__dropdown-item--ellipsis CSS rules

Could you please review and confirm?

Thank you.

oivanov’s picture

Status: Needs review » Reviewed & tested by the community

All four issues from my review have been fixed:

1. Docblock corrected to template_preprocess_views_dropdown_pager() (was incorrectly prefixed with hook_).
2. "license": "GPL-2.0-or-later" added to composer.json.
3. Unnecessary #input => TRUE removed from details form elements.
4. Duplicate .pager__dropdown-item--ellipsis CSS rule consolidated.

No remaining issues. Setting to Reviewed & tested by the community.

avpaderno’s picture

Assigned: Unassigned » avpaderno

Thank you for your contribution and for your patience with the review process!

I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.

These are some recommended readings to help you with maintainership:

You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank also all the reviewers for helping with these applications.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.