Recommend (or at least mention) Media Library Media Modify for when using with a media library, for local modifications while preserving the alt text in the library.

Created on 30 August 2023, about 1 year ago

Problem/Motivation

As the project page notes, "while this module works just fine with the Media module, it's best not to rely on it if your site uses the same image in multiple different contexts, as you won't be able to change the alt text per context"

Using the wonderful Media Library Media Modify in combination with Decorative Image Widget 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!

Steps to reproduce

Use Media Library Media Modify module's Media with contextual modifications field to reference a media image and configure Decorative Image Widget as usual (note that you may have to configure it for two form modes, both Media library and Default).

Proposed resolution

Document this as the recommended setup for using Decorative Image Widget with Media.

Remaining tasks

📌 Task
Status

Active

Version

1.0

Component

Documentation

Created by

🇺🇸United States mlncn Minneapolis, MN, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024