No Code Attached Yet
avatar GhekkoNL
GhekkoNL
19 Mar 2025

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); ?>

avatar GhekkoNL GhekkoNL - open - 19 Mar 2025
avatar joomla-cms-bot joomla-cms-bot - change - 19 Mar 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 Mar 2025
avatar brianteeman
brianteeman - comment - 19 Mar 2025

I think you are mistaken

If joomla is set to only display flags for the language selector then title and alt attributes are used

Image

If joomla is set to display languages as a text dropdown with flags then the flag is correctly marked as a decorative image

Image

avatar GhekkoNL
GhekkoNL - comment - 19 Mar 2025

I think you are mistaken

If joomla is set to only display flags for the language selector then title and alt attributes are used

Image

If joomla is set to display languages as a text dropdown with flags then the flag is correctly marked as a decorative image

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.

avatar brianteeman
brianteeman - comment - 19 Mar 2025

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.

avatar chmst
chmst - comment - 19 Mar 2025

@GhekkoNL Joomla core does it. I suppose that you have an override in your template.
EDIT - too late :)

avatar chmst chmst - change - 19 Mar 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-03-19 12:52:30
Closed_By chmst
avatar chmst chmst - close - 19 Mar 2025
avatar chmst
chmst - comment - 19 Mar 2025

Closing, it is not a joomla issue

Add a Comment

Login with GitHub to post a comment