Skip to content

Template accessibility

William Jacoby edited this page Oct 28, 2026 · 1 revision

Template accessibility scanner

phpbb-test-board/template_a11y.py path/to/project [more projects...]

Scans an extension's or style's templates (styles/, adm/style/, or a style's template/) for links and buttons that show only an icon. Each needs a title for the tooltip and screen-reader text, a <span class="sr-only"> inside it or an aria-label, both from a language string:

<a href="{U_CHECK}" title="{L_CHECK}"><i class="icon fa-search fa-fw" aria-hidden="true"></i><span class="sr-only">{L_CHECK}</span></a>

In ACP templates (adm/style/) use aria-label instead of the span: the ACP style has no sr-only class, so the text would show. A title on the icon itself, phpBB's ACP pattern, counts as the tooltip, and a link around an image with alt text passes. Problems are printed as FILE:LINE: message, and the exit status is 1 if there are any. It needs no board and only Python's standard library.

The positional argument is one or more project directories; -h/--help displays help. There are no board, Git ref, port or output-file options.

template_a11y.py /path/to/extension /path/to/style

This reads current template files directly, so local edits are included. It is a static pattern check, not a complete accessibility audit. It does not verify focus behavior, contrast, responsive layout or screen-reader announcements in a browser.

Clone this wiki locally