Issue:
It can be difficult for screen-reader users to determine the role / purpose of links in a breadcrumb trail because there is no semantic markup to indicate the role or purpose of the links.

Recommendation:
Provide semantic markup to identify role / purpose of breadcrumb links. Possibly by hiding this information offscreen using classes defined in #473396: Defining System-Wide Approaches to Remove, Make Invisible & Push Content Off-screen with CSS.

Example:

You are here:

or,

Breadcrumb navigation:

{breadcrumb markup}{

Resources:
theme_breadcrumb - http://api.drupal.org/api/function/theme_breadcrumb/7

G65: Providing a breadcrumb trail (Techniques for WCAG 2.0) - http://www.w3.org/TR/WCAG-TECHS/G65.html

Preferred breadcrumb implementation (WebAIM discussion list) - http://www.webaim.org/discussion/mail_message.php?id=8971

Comments

Everett Zufelt’s picture

Priority: Normal » Critical
StatusFileSize
new1.31 KB

This patch adds semantic markup to provide information for screen-reader users to define the role of the list of links in the breadcrumb.

1. modified includes/theme.inc: theme_breadcrumb() and themes/garland/template.php: garland_breadcrumb() to add an invisible span with the text "You are here:".

Example from theme.inc:

    return '<div class="breadcrumb"><span class="visibility-invisible">You are here:</span>' . implode(' » ', $breadcrumb) . '</div>';

2. Using CSS style class "visibility-invisible" being defined in #473396: Defining System-Wide Approaches to Remove, Make Invisible & Push Content Off-screen with CSS this text will only be presented to screen-reader users.

Everett Zufelt’s picture

Status: Active » Needs review

Priority: Critical » Normal
Status: Needs review » Needs work

The last submitted patch failed testing.

Everett Zufelt’s picture

Status: Needs work » Needs review
StatusFileSize
new1.76 KB

Rerolled the patch.

This patch provides a h2 heaing with the text "You are here", made invisible with .element-invisible, directly before the breadcrumb liks in includes/theme.inc and themes/garland/template.php

mgifford’s picture

StatusFileSize
new1.7 KB

Small correction in this patch. Like how this is done with the simple "You are here" text.

Great that it's following the example set with WebAim:
http://webaim.org/blog/screen-reader-testing-is-back-in-style/

Works fine in Garland & Seven with this new patch.

+1

owen barton’s picture

Note that some usability experts (e.g. Crug) recommend using "You are here" in front of breadcrumbs for ALL users (i.e. including visual users).

This may need to be determined on a site by site basis (since on simple, flat sites breadcrumbs are perhaps not as important) but I think it is worth considering. Perhaps the core theme function could make it visible, but Garland could add the element-invisible class since the most common out of the box Garland site is quite simple.

mgifford’s picture

StatusFileSize
new1.72 KB

I'm not sure that most designers would want to see that there. I think the usability thing should come as a separate issue. It probably would improve everyones experience though.

I had to wrap this as we forgot the t()

Everett Zufelt’s picture

+1 to the patch in #7. I agree that we should check with the usability folks about making the heading "You are here" visible to all, but that this should come in a separate issue.

bowersox’s picture

+1 for the patch in #7. The code and the comment look good to me. I tested and confirmed it works and has no visual impact in:

  • Firefox 3.5, Safari 4, IE 6, and IE 7
  • Seven and Garland
  • And JAWS which says, "Heading level 2 You are here visited link Home link Blogs link Brandon's Blog"

Again, the justification for using element-invisible and h2 applies to this just like #515236: theme_status_messages needs additional markup to be more apparent to assistive technology users and others.

Bojhan’s picture

This should not be visible for anything but screenreaders, it should be appear ant and has become a standard over the years. On the semantic value of this change I cannot judge.

mgifford’s picture

This particular patch is just for accessibility and shouldn't affect usability. Don't think there's any reason to wait before marking this RTBC.

If the "You are here" is to be visible then it should be another issue and should undergo a usability review. I like the idea, but it should be a separate issue.

dries’s picture

Status: Needs review » Fixed

Looks good. Committed to CVS HEAD.

Everett Zufelt’s picture

Status: Fixed » Needs work

@Dries

Does this issue need documentation, if so where? Setting to NW awaiting answer on documentation.

Everett Zufelt’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

liam morland’s picture

RedTop’s picture

The current output results in a warning when validating against WSCAG 2.0 AAA, recommending the breadcrumb to be output as a list.

Solution

$output .= '<div class="breadcrumb">' . '<ul><li>' . implode('</li><li> » ', $breadcrumb) . '</li></ul>' . '</div>';

Found here:
http://www.otakunozoku.com/php-imploded-wrap/

My apologies for not providing a patch, still only just venturing into developer territory...

mgifford’s picture

Version: 7.x-dev » 8.x-dev
Category: task » feature
Status: Closed (fixed) » Active

WCAG 2.0 AA is presently the goal for Drupal. But no reason we can't exceed it. Moving this to d8 and making it a feature request.

Everett Zufelt’s picture

Version: 8.x-dev » 7.x-dev
Category: feature » task
Status: Active » Closed (fixed)

This is somewhat related to the original issue, but is a new request. Please open a new issue, in which you can reference this issue.

liam morland’s picture

Drupal 8 is already as suggested.

mgifford’s picture

Just opened a new issue #1687864: Bring theme_breadcrumb() up to WCAG 2.0 AA it is really the right thing to do. This issue was fixed for D7 and makes sense to make this a new request.