Skip to content

Commit

Permalink
MDL-62143 accessibility: Label breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Jan 9, 2019
1 parent 7f234ac commit 0d72593
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/outputrenderers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3579,6 +3579,9 @@ protected function render_breadcrumb_navigation_node(breadcrumb_navigation_node
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);

Expand Down
4 changes: 2 additions & 2 deletions theme/boost/templates/core/navbar.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
]
}
}}
<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}}
Expand Down

0 comments on commit 0d72593

Please sign in to comment.