Providing an explicit "This image is decorative and provides no information not already in the text" checkbox to blank out alt text

Events happening in the community are now at Drupal community events on www.drupal.org.
mlncn's picture

It's essentially undocumented on the web and in Drupal that a content editor who uploads an image can make a required alt text produce an empty alt tag with "" in the alt text field.

I think it would be a much better editor experience to have a checkbox: "This image is decorative and provides no information not already present in text."

This would then produce the empty alt tag for them.

It would also help people learn about the purpose of alt text (and maybe make us think more about using images that do provide some value).

I am sure that there are site administrators who have made the alt field not required because they didn't know how to leave it blank, and i know for a fact that there are countless content editors putting in meaningless text for informationless images.

What do accessibility people, usability people, and other people who care think about this? Has anyone done something similar with a custom form_alter()? Any experience with that? Given that it was rejected from core, i'm thinking about making a contrib module to do this.

Comments

That would be wonderful if

anevins's picture

That would be wonderful if images were used in only one context and people knew in advance of that context, and that context never changed :) But we can't make that assumption.

See

Decorative Image Widget Module

cedewey's picture

Good point mlncn.

The Decorative Image Widget module does exactly this https://www.drupal.org/project/decorative_image_widget

I have yet to use it on a project, but am considering it for one right now. I'll report back on its impact if it does make it into the website.

Finally putting it all together

mlncn's picture

Using Decorative Image Widget mentioned above with the wonderful Media Library Media Modify is pretty close to ideal:

https://www.drupal.org/project/decorative_image_widget/issues/3384144

benjamin, agaric

Accessibility

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: