Add ability to configure to display the caption based on view mode.

Created on 12 May 2016, over 8 years ago
Updated 22 January 2024, 10 months ago

Problem/Motivation

Currently image captions appear in all view modes. In some contexts this is now what's desired. For example, a teaser view may include a photo but not its caption.

Proposed resolution

Provide the ability to configure caption display on the Manage Display page for each content type.

In Drupal 7, the preferred solution for modifying the settings of another module's field formatters is to use the Field Formatter Settings β†’ helper module.

To avoid introducing a new dependency, which might require a new branch, implement this as an optional enhancement.

Test for the view mode configuration in a field preprocessor. Also move sanitizing out of the theme functions to that preprocessor.

Remaining tasks

Add an update to clear caches so the new hook implementations are recognized?

User interface changes

Image caption display is configurable per field per view mode.

API changes

Data model changes

Release notes snippet

Introduces the ability to configure image caption display per view mode. This optional enhancement requires the Field Formatter Settings module to be installed.

✨ Feature request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States albertski

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