3

I am tasked with structuring our current website into ADA compliance and it has been a pain to get everything updated, so I have some questions regarding the headers.

We have the following code in on of our "Page Templates":

<main class="content">
    <div class="row">
        <div class="small-12 columns text-center">
            <header class="collection__header">
                <h1>{{ entity.site.get_site_name | raw }}</h1>
                <div class="expanded row">
                    <div class="small-12 large-offset-1 large-10 columns">
                        <div class="page-description">{{ entity.get_content | raw }}</div>
                    </div>
                </div>
            </header>
        </div>
    </div>
</main>

We have our entity.get_content() call, which pulls in the WordPress "Post Content" box:

Screenshot of WYSIWYG editor with HTML content


The Problem:

When someone passes in a header tags (Which WordPress allows) within the post content, it throws off the ADA Header structure "Skipped Header" as shown below:

Screenshot of component on webpage throwing ADA errors

Does anyone know how someone can safely pass in any header tags inside the "Post Content" and we still are ADA compliant? If they pass in the h2 tag, that's fine, but if they pass in the h3 tag as shown in the screenshot, the ADA headers get throws compared to the theme build.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Sem
  • 55
  • 5
  • Jumping from H1 to H3 is what's triggering this ADA compliance error. You're not supposed to do that. Instead, make sure that editors follow proper [heading hierarchy](https://www.w3.org/WAI/tutorials/page-structure/headings/). – cabrerahector Jun 07 '22 at 19:35
  • It's a "best practice" to not skip heading levels but it is not a strict ADA (or WCAG) failure to do so. Many scanning tools will flag it in error but if your scanning tool allows you to turn off warnings and best practices and only show true errors, this issue should not show up. That doesn't mean you should skip heading levels, but it's not necessarily an error. – slugolicious Jul 29 '22 at 20:30
  • Improper use of heading levels remains among the [Top Ten Most Common Web Accessibility Issues in 2022](https://www.tpgi.com/ten-common-web-accessibility-issues/#post-5615). It should be an error. And it bugs me that CMSs apparently still don’t offer filters that would assure a certain heading level. Texts are reused in different contexts, so it should be possible to decide at which level the headings should start. So in this case you would call `{{ entity.get_content | h2 }`, and the `

    ` would turn into a `

    `.

    – Andy Aug 01 '22 at 08:37

1 Answers1

0

76.7 % of screen reader users rely on Navigating through the headings on the page as the primary means to Finding Information on a lengthy webpage.

WebAIM Screen Reader User Survey #9 Results, 2021

Just as sighted users do as well (skimming).

Anybody would be confused when trying to navigate a long document via the table of contents which has gaps and unrelated headings grouped.

So while there currently is no hard conformance-criteria for a consistent heading-level-order (afaik), it is important.

Many scanning tools will flag it in error but if your scanning tool allows you to turn off warnings and best practices and only show true errors, this issue should not show up.

What could a developer do?

It’s a CMS’s job to manage content and make it usable in different contexts (adaptive content). That includes adapting heading levels to the context.

One solution might be the following:

<div class="page-description">{{ entity.get_content | start_at_h2 }}</div>

which turns the <h3> into a <h2>, h4 → h3 and so on:

<div class="page-description">
<hgroup>
  <h2 style="text-align: center;">We’re the people…
</hgroup>
</div>

Maybe somebody already wrote an extension for WordPress?

What can you do in procurement?

It should be a CMS’s job to support authors providing good adaptive content. Meaning that if you care about your final output being ADA compliant, you should choose a CMS that helps you achieve that.

Part B: Support the production of accessible content of the Authoring Tool Accessibility Guidelines (ATAG) explains what a CMS needs to do to be compliant. You could go and find a CMS that is certified.

In this case, it could warn the author about the heading level, and about the heading text being way too long.

To fix the issue from a developer’s perspective, I could imagine a filter that helps keep the heading levels consistent. Because it’s the developer who puts the content into context.

Andy
  • 4,783
  • 2
  • 26
  • 51