In Panopoly 1.x, we had the ability to override the alt and title of an image for a particular embed. Meaning, the media entity might have had a default alt and title saved on the entity, but when embedding, you'd be able to change it for just this particular embed.

The use case is where you have a media library of stock images, which may have a different alt or title in that particular context, which is needed for a properly accessible text version of the content.

In Panopoly 2.x, we don't currently have the ability to do this. However, I did Google up #2924391: [media entities] Regardless of @EntityEmbedDisplay plugin, Media entities representing a `image/*` MIME type should be able to have a per-embed `alt` and `title` which has already been merged, so perhaps this is something we can just use now?

Comments

dsnopek created an issue.

kerasai’s picture

Wow, entity_embed is a very active project at the moment.

I've found that the 8.x-1.0-rc2 release is at the point where #2924391: [media entities] Regardless of @EntityEmbedDisplay plugin, Media entities representing a `image/*` MIME type should be able to have a per-embed `alt` and `title` was committed--the second of two commits. I'll test with that.

kerasai’s picture

I tested this, and it works well.

Things we'll need to do to implement this:

  1. Update our version of entity_embed to 8.x-1.0-rc2
  2. Presumably, merge #3051433: Update panopoly_media for latest changes in Drupal 8.7, as we have to adjust the media field config (see below)
  3. Modify the media.panopoly_media_image.field_media_image field to allow title input on image uploads
  4. Tweak text formats in panopoly_wysiwyg to allow alt and title attributes on <drupal-entity> tags. I think this only applies to panopoly_wysiwyg_basic.

Patch to come.