Commit 261684 by dries
- Patch #526674 by Everett Zufelt, mgifford: made breadcrumbs more accessible for visually impaired people.
--- includes/theme.inc 2009/09/11 06:48:02 1.521
+++ includes/theme.inc 2009/09/11 14:14:16 1.522
@@ -1509,7 +1509,12 @@
*/
function theme_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
- return '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
+ // Provide a navigational heading to give context for breadcrumb links to
+ // screen-reader users. Make the heading invisible with .element-invisible.
+ $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
+
+ $output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
+ return $output;
}
}
--- themes/garland/template.php 2009/09/01 20:39:55 1.29
+++ themes/garland/template.php 2009/09/11 14:14:16 1.30
@@ -10,7 +10,12 @@
*/
function garland_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
- return '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
+ // Provide a navigational heading to give context for breadcrumb links to
+ // screen-reader users. Make the heading invisible with .element-invisible.
+ $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
+
+ $output .= '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
+ return $output;
}
}
+++ includes/theme.inc 2009/09/11 14:14:16 1.522
@@ -1509,7 +1509,12 @@
*/
function theme_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
- return '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
+ // Provide a navigational heading to give context for breadcrumb links to
+ // screen-reader users. Make the heading invisible with .element-invisible.
+ $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
+
+ $output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
+ return $output;
}
}
--- themes/garland/template.php 2009/09/01 20:39:55 1.29
+++ themes/garland/template.php 2009/09/11 14:14:16 1.30
@@ -10,7 +10,12 @@
*/
function garland_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
- return '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
+ // Provide a navigational heading to give context for breadcrumb links to
+ // screen-reader users. Make the heading invisible with .element-invisible.
+ $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
+
+ $output .= '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
+ return $output;
}
}