When you have a menu item with an image, and you choose to not display the title, the link is inaccessible for screen readers as it is "empty".
Bare minimum accessibility standards.
One of two ways:
We help site builders be a little more accessible by default. :)
I'm happy to contribute the first fix if that works better for the project - it's just two lines of code. The second one is a bit outside of my comfort zone as it stands.
Labels |
Added:
?
|
The way I've done it is with an html module override of default_component.php
and default_url.php
by modifying the block with the menu text params like so:
if ($item->params->get('menu_text', 1))
{
$linktype .= '<span class="image-title">' . $item->title . '</span>';
} else {
$attributes['aria-label'] = $item->title;
}
Just not sure that's the best solution for the CMS as a whole. It works for me and it's accessible.
Hmm, wonder why it's not on my site. I'll double check.
You're right. I am doing an additional override to accept SVGs, which made it not happen. Oops. -facepalm-
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-04-15 09:11:22 |
Closed_By | ⇒ | crystalenka |
I just double checked to make sure it wasn't a template override and its not. I also double checked that the screen reader announces it correctly and it does
happens to the best of us
I have done this on one of my sites. Checking now to see how I did it