简体   繁体   English

为什么我在 WordPress 标头上的 ADA 合规性失败,从<h1>至</h1><h3> ?</h3>

[英]Why do I fail ADA Compliance on WordPress Headers by jumping from <h1> to <h3>?

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.我的任务是将我们当前的网站构建成 ADA 合规性,更新所有内容一直很痛苦,所以我对标题有一些疑问。

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:我们有entity.get_content()调用,它会拉入 WordPress “发布内容”框:

带有 HTML 内容的所见即所得编辑器的屏幕截图


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:当有人在帖子内容中传入 header 标签(WordPress 允许)时,它会抛出 ADA Header 结构“Skipped Header”,如下所示:

网页上的组件引发 ADA 错误的屏幕截图

Does anyone know how someone can safely pass in any header tags inside the "Post Content" and we still are ADA compliant?有谁知道有人可以安全地在“发布内容”中传递任何 header 标签,并且我们仍然符合 ADA 标准? 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.如果他们传入h2标记,那很好,但如果他们传入h3标记,如屏幕截图所示,与主题构建相比,ADA 标头会被抛出。

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. 76.7% 的屏幕阅读器用户依赖浏览页面标题作为在冗长网页上查找信息的主要方式。

WebAIM Screen Reader User Survey #9 Results, 2021 WebAIM 屏幕阅读器用户调查 #9 结果,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.因此,虽然目前没有一致的标题级别顺序(afaik)的硬性一致性标准,但它很重要。

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).管理内容并使其在不同的上下文中可用(自适应内容)是 CMS 的工作。 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:这会将<h3>变成<h2> , h4 → h3 等等:

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

Maybe somebody already wrote an extension for WordPress?也许有人已经为 WordPress 写了一个扩展?

What can you do in procurement?采购方面能做什么?

It should be a CMS's job to support authors providing good adaptive content.支持作者提供良好的自适应内容应该是 CMS 的工作。 Meaning that if you care about your final output being ADA compliant, you should choose a CMS that helps you achieve that.这意味着如果您关心您的最终 output 是否符合 ADA,您应该选择一个可以帮助您实现这一目标的 CMS。

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. B 部分:支持创作工具可访问性指南 (ATAG) 的可访问内容的制作解释了 CMS 需要做什么才能合规。 You could go and find a CMS that is certified.您可以 go 并找到经过认证的 CMS。

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.因为是开发人员将内容放入上下文中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM