fbpx
Introducing JD Builder - Now Beat the unbeatable designsDownload For Free
Welcome, Guest
Username: Password: Remember me

Building something on Astroid?

Submit your site to be featured in our monthly Astroid Site Showcase!

Submit Now

TOPIC: Accessibility: Logo image ALT

Accessibility: Logo image ALT 1 week 5 days ago #17465

Due to our government regulations on website accessibility, the ALT tag of all meaningful images must be meaningful. Barely using sitename for the logo ALT will not be compliant with the law. I, therefore, made the following changes on JD_Paris:

(1) atroid/options/header.xml:
add a new field logo_imgalt after the field mobile_logo:
<field astroidgroup="header_element" description="TPL_ASTROID_BASIC_LOGO_IMGALT_DESC" ngShow="header==true AND logo_type=='image'" name="logo_imgalt" type="astroidtext" class="form-control" label="TPL_ASTROID_BASIC_LOGO_IMGALT_LABEL">
</field>

(2) add corresponding strings TPL_ASTROID_BASIC_LOGO_IMGALT_LABEL and TPL_ASTROID_BASIC_LOGO_IMGALT_DESC to language files.

(3) frontend/logo.php:
(3.1)add a new variable $logo_imgalt after $sticky_header_log:
$stickey_header_logo = $params->get('stickey_header_logo', false);
$logo_imgalt = $params->get('logo_imgalt', $sitename);
(3.2)modify the following lines by change $sitename to $logo_imgalt:
<a class="<?php echo implode(' ', $class); ?><?php echo $mr; ?>" href="<?php echo JURI::root(); ?>">
<?php if (!empty($default_logo)) { ?>
<img src="<?php echo JURI::root() . '/images/' . $default_logo; ?>" alt="<?php echo $logo_imgalt; ?>" class="astroid-logo-default" />
<?php } ?>
<?php if (!empty($mobile_logo)) { ?>
<img src="<?php echo JURI::root() . '/images/' . $mobile_logo; ?>" alt="<?php echo $logo_imgalt; ?>" class="astroid-logo-mobile" />
<?php } ?>
<?php if (!empty($stickey_header_logo)) { ?>
<img src="<?php echo JURI::root() . '/images/' . $stickey_header_logo; ?>" alt="<?php echo $logo_imgalt; ?>" class="astroid-logo-sticky" />
<?php } ?>
</a>

Is there a better way to do it? Can logo_imgalt be a default feature?
Last Edit: 1 week 5 days ago by brian.huang.2019.
The administrator has disabled public write access.

Accessibility: Logo image ALT 1 week 5 days ago #17466

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 2851
  • Thank you received: 439
  • Karma: 91
Thanks for getting this done, we'll try to include it in the future version of Astroid as a core/default feature.

Thanks,
Chetan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The administrator has disabled public write access.
Time to create page: 0.238 seconds