The Drupal 7 pager has very poor accessibility support. One word links in the pager read by a screen reader (E.g. "one" "two" "three" "next" "last") lose all meaning and are impossible to interpret when taken out of context (WCAG 2.0, section 2.4.9)

This is largely fixed now in Drupal 8, so I've written a backport of pager.twig.html from Drupal 8 to pager.tpl.php for Drupal 7 for a client university project that wants to improve the #a11y support on their library Drupal 7 website.

The gist here is meant for someone to be able to paste this into their theme:

I've written the DOM changes in a way that leverages existing Drupal 7 classnames and styles, without causing any visual changes, and I think Drupal core could benefit from this contribution.

But before I start working on a patch for D7 core, is Drupal 7 accepting such backport issues for accessibility improvements?

Comments

jwilson3 created an issue. See original summary.

jwilson3’s picture

I've checked the backport policy but found no mention of accessibility.

The only thing listed there that is cause for concern on this issue is:

* Any change in HTML or CSS can interfere with custom CSS from custom themes and modules.

The gist as posted above does slightly change the DOM structure for the current page item in the pager list. In D8, the current page is wrapped in an anchor link tag (i've currently written the backport to do this also), but in current core D7, the current page has no link tag.

The rest of the HTML changes I don't think would break themes, as we're only adding spans and hidden divs containing accessible text hidden on the screen.

So, I'lI need to rework how the current page <li> element is created when converting this to a patch.

jwilson3’s picture

Issue summary: View changes

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.