Add hidden caption

Created on 4 November 2020, about 4 years ago
Updated 22 January 2024, 11 months ago

Problem/Motivation

We needed a second caption that is visually hidden to provide more details to people using screen readers.

User interface changes

Adds an extra setting and extra text area.

Data model changes

Adds fields to the table.

I am not expecting this to get added to the module as I imagine it's rather an edge case but, since I had to build it for the client, I figured I would share it for whomever might find it useful.

Some caveats:

  • I changed the schema but there's no matching update function because we are installing the module fresh.
  • I didn't do anything with the views integration because we don't need it.
  • I don't understand image_field_caption_field_diff_view_alter() enough to know what I need to do there so there's just a "todo".
  • You need to have .visually-hidden set to display: none in your theme or the hidden caption will show.
  • The captions show one right after another so that may end up being confusing to screen readers unless you are careful with how they are worded. This may get refined at some point after we see how it works in practice.
✨ Feature request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States michelle Wisconsin, USA

Live updates comments and jobs are added and updated live.
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.

Production build 0.71.5 2024