Update Help Text Standards Examples to Modify Heading Structure

Created on 17 April 2018, over 6 years ago
Updated 16 February 2024, 9 months ago

Problem/Motivation

We should encourage developers to follow best practices for accessibility when building Drupal modules. The current Help Text Standards β†’ provide example code and a standard template for hook_help() implementations, which uses h3 as the heading level for section titles. The standard was adopted about 9 years ago, without a lot of discussion except along the lines of "better to have headers and a standard template than what we had before" on this issue:
#537828: Help text for core modules - update to conform to new standard β†’

When hook_help() pages are output, they go on a page such as admin/help/link. Assuming a configuration like in the Standard install profile, with Seven theme and the usual blocks, the page structure has an H1 at the top for the page title, and then in the main content region, the next header is the H3 saying "About". There is no H2 on the page, except in the Toolbar area, which is outside the hierarchy of the main content region.

However, in order to follow best practices for accessibility, Techniques for WCAG 2.0: organizing a Page Using headings, sections should begin with an h2 and subsections an h3.

To facilitate navigation and understanding of overall document structure, authors should use headings that are properly nested (e.g., h1 followed by h2, h2 followed by h2 or h3, h3 followed by h3 or h4, etc.).

Proposed resolution

Update the following on the Help Text Standards β†’ documentation:

Documentation changes

1. Help page β†’

Add a 'Headings' section.

2. ">Help Topic Standards

Add a link to the 'Heading' section that is added in 1 to the Help Topic Syntax Example β†’ .

Headings

  • Use an h2 element to indicate major sections of your help page.
  • Should your sections contain subsections, Use an h3 element to indicate each subsection.
  • Do not skip heading levels. An h2 should be followed by another h2, or an h3.

Remaining tasks

Update proposal to include Help Topic standards, #22

  • Update Help Text Standards documentation.
  • Then patch Drupal core, at least, to change the headings to H2 in the modules' implementations of hook_help(). πŸ“Œ Change help headings for WCAG 2.0 Active
  • A change record, noting hook_help() now uses improved heading levels, and encouraging contrib/custom module maintainers to do the same.

Coder changes

1. Link to Coder issue

πŸ“Œ Task
Status

Fixed

Version

11.0 πŸ”₯

Component
HelpΒ  β†’

Last updated 28 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States RachelOlivero

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

  • Documentation

    Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024