29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-28 16:13:42 +00:00
cms/language
Brian Teeman 4c8270f11d
[4.0] Intro and Full image accessibility (#31318)
* [4.0] Intro and Full image accessibility

An alt text provides an accessible description of an image. Most of the time you should always have one. You should never not have any alt because then assistive technology such as a screenreader will announce the filename. See the October Joomla Magazine article on this

In the rarer situation that the image is purely decorative then it is acceptable to have an empty alt text which should be alt="".

Currently there are several places in Joomla where if you are too lazy to enter a text description of the image then joomla will insert alt="" While this does prevent the filename being read aloud it is not good practice as you are preventing a significant % of your readers being able to access all the content.

Research conducted by the EU shows that content creators want to (need to) create accessible content but don't really know how. The main tool that they have available to them is an accessibility checker. And they then act upon the findings of that tool.

**If the content author performs an accessibility check of their site then most checkers will not report any errors or warnings about missing descriptions as it sees the alt="" and ignores it.**

Adding alt="" is perfectly valid for a decorative image only. It should be a conscious/active decision to mark an image as decorative.

Comment from @brucel confirming this https://github.com/joomla/joomla-cms/issues/31138#issuecomment-711789514

Comment from @mgifford confirming this
https://github.com/joomla/joomla-cms/issues/31138#issuecomment-712222061

Adding an additional helptext to the description is not enough

Making this a required field is not possible in Joomla with the current codebase as it would only be required IF there is an image and we dont have support for that condition.

Suggesting that you have to put `""` in the description to mark something as decorative is not very user friendly and it is actually adding more keystrokes etc than skipping to the next field and checking the box - as explained to @carcam

The correct use of alt text is **not** advanced accessibility. It is very basic accessibility and addressed at level A

There is no point in making the commitment and statement that Joomla itself is accessible if it at the same time makes it harder to create an accessible site.

### Testing
Testing is really easy. No npm, js or css involved.
Merge the pull request and then go to edit an article on both the admin and site. For the site you might need to enable the frontend images and urls option in the component.

You now have a new field and tweaked text

Please test three scenarios when adding an intro image

1. Image Description (Alt Text) = Empty
No Description = unchecked

2. Image Description (Alt Text) = "some description"
No Description = unchecked

3. Image Description (Alt Text) = Empty
No Description = checked

The expected behaviour for each of these tests is

1. `<img loading="lazy" src="filename.jpg" itemprop="thumbnailUrl">`
2. `<img loading="lazy" src="filename.jpg" alt="some description" itemprop="thumbnailUrl">`
3. `<img loading="lazy" src="filename.jpg" alt itemprop="thumbnailUrl">`
or `<img loading="lazy" src="filename.jpg" alt="" itemprop="thumbnailUrl">`

* Update full_image.php

code style
2020-11-07 09:25:05 +01:00
..
en-GB [4.0] Intro and Full image accessibility (#31318) 2020-11-07 09:25:05 +01:00
overrides -$ Removing both en-GB.override.ini as they overwrite the existing ones 2011-10-09 12:29:31 +02:00
index.html Adding back some index.html files. 2014-12-11 09:01:10 +01:00