MDL-62143 accessibility: Label breadcrumbs
authorDamyon Wiese <damyon@moodle.com>
Fri, 10 Aug 2018 08:54:36 +0000 (16:54 +0800)
committerDamyon Wiese <damyon@moodle.com>
Wed, 9 Jan 2019 07:14:04 +0000 (15:14 +0800)
lib/outputrenderers.php
theme/boost/templates/core/navbar.mustache

index 7181ffe..bbbf2e0 100644 (file)
@@ -3579,6 +3579,9 @@ EOD;
             if ($item->hidden) {
                 $attributes['class'] = 'dimmed_text';
             }
+            if ($item->is_last()) {
+                $attributes['aria-current'] = 'page';
+            }
             $content = html_writer::tag('span', $content, array('itemprop' => 'title'));
             $content = html_writer::link($item->action, $content, $attributes);
 
index 07d0c04..2998888 100644 (file)
         ]
     }
 }}
-<nav role="navigation">
+<nav role="navigation" aria-label="{{#str}}breadcrumb, access{{/str}}">
     <ol class="breadcrumb">
         {{#get_items}}
             {{#has_action}}
                 <li class="breadcrumb-item{{#is_hidden}} dimmed_text{{/is_hidden}}">
-                    <a href="{{{action}}}" {{#get_title}}title="{{get_title}}"{{/get_title}}>{{{get_content}}}</a>
+                    <a href="{{{action}}}" {{#is_last}}aria-current="page"{{/is_last}} {{#get_title}}title="{{get_title}}"{{/get_title}}>{{{get_content}}}</a>
                 </li>
             {{/has_action}}
             {{^has_action}}