[META] Improve workflows for image alternative text

Created on 4 January 2018, over 6 years ago
Updated 30 August 2023, 10 months ago

Problem/Motivation

When setting an image field to have a required alt text, it's not possible to mark an image as decorative. Consider these two options:

  1. Site builder DOES NOT make alt required. This allows empty alt text (and thus supports decorative images) but in all likelihood will discourage content authors from populating an alt text unless they are very well trained.
  2. Site builder DOES make alt required. This forces editors to put something in for alt text, but it completely prevents them from marking e image as decorative.

A colleague recently wrote:

It should be optional (so users can mark images as decorative), but leaving it blank should be difficult โ€“ we want people to have to affirmatively choose to mark an image as decorative, rather than assume an image is decorative if they forget to fill out a field.

Proposed Solution

When alt text is required, add a checkbox that allows the editor to bypass the requirement by affirming the image is decorative only. We can likely do this without also having to store the value of that decorative checkbox, as we can infer it based on existing value of the alt text.

For situations where the alt text is NOT marked as required, it probably doesn't make sense to add this checkbox, but maybe.

Original Report

For the core "image" module, we really need a checkbox option for decorative images. So many large drupal projects with many contributors adding content are making the alt text "required to keep their sites accessible. By doing so, this forces screen readers to read alt text for every image that is placed on the site especially when they have no purpose.

By having a "decorative" checkbox for the required image alt field, it could be checked and create a null field. We need something obvious for limited permission content editors. Wordpress has this option with their accessibility plugin. It lets you check the decorative box and then leave the alt text box empty.

This is very important as drupal 8 has really come a long way with the accessibility and continues to do so. Our higher education sites depend on this. Thank you for doing such a great job so far!

โœจ Feature request
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component
Image systemย  โ†’

Last updated about 23 hours ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States LiLynn

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States RMattB

    Summarizing the easy fix from a long analysis in #3230231 :
    Prepend 3 words: "For meaningful images," to "Short description of the image used by screen readers and displayed when the image is not loaded."

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mgifford Ottawa, Ontario

    Adding related content from the We4Authors Cluster process - https://accessibilitycluster.com/main-results/text-alternative-feature-%...

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

    Using Decorative Image Widget โ†’ mentioned above with the wonderful Media Library Media Modify โ†’ is pretty close to ideal. The latter module provides a "Media with contextual modifications" reference field which lets aspects of the media object be overridden from the content context where it is used. This includes the alt text and the "This image is decorative and should be hidden from screen readers" checkbox!

    Note that Decorative Image Widget, if both the Decorative checkbox is checked AND there is alt text, will behave as if the checkbox was not checkedโ€” it will save as alt text. So to use an image from your media library that has an image description as a decorative image, you need to blank out the alt text and check the Decorative checkbox. But the alt text lives on in the media library, and will be available if you re-use that image!

Production build 0.69.0 2024