When using mod_languages i am missing the title and alt names in this code:
<?php echo HTMLHelper::_('image', 'mod_languages/' . $language->image . '.gif', $params->get('full_name') ? '' : $language->title_native, null, true); ?>
If you want a better SEO and a better use for blind and partially sighted people you might want to use this code:
<?php echo HTMLHelper::_('image', Uri::root() . 'images/' . $language->image . '.gif', !empty($language->title_native) ? $language->title_native : $language->title, ['alt' => !empty($language>title_native) ? $language->title_native : 'Language flag', 'title' => !empty($language->title_native) ? $language->title_native : $language->title,], true); ?>
Labels |
Added:
No Code Attached Yet
|
I think you are mistaken
If joomla is set to only display flags for the language selector then title and alt attributes are used
If joomla is set to display languages as a text dropdown with flags then the flag is correctly marked as a decorative image
On my setup it doesn't
<a href="/en/"><img alt="" width="30" height="30" src="https://example.nl/images/en_gb.svg"></a>
And with this solution it always does.
That code is not from the core of Joomla.
Please test with the default cassiopeia template to ensure that the template you are using does not have an "override" for the module which is producing the broken code or that you dont have a non-core language switcher module installed.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-03-19 12:52:30 |
Closed_By | ⇒ | chmst |
Closing, it is not a joomla issue
I think you are mistaken
If joomla is set to only display flags for the language selector then title and alt attributes are used
If joomla is set to display languages as a text dropdown with flags then the flag is correctly marked as a decorative image