Add formatters for image with caption instead of overriding the default

Created on 21 September 2015, about 9 years ago
Updated 22 January 2024, 10 months ago

Problem/Motivation

This comes from #1967656-8: Add views support . Today we override the default image formatter to add the caption, so there is no way to show the image with no caption, or the caption alone without the image.

Proposed resolution

Remove our hook_theme_registry_alter and define two new formatters (one that replicates the current functionality showing the image and the caption and another to show the caption only), leaving the default image formatter alone. This way the site builder can choose between displaying the image, the caption or both.

Remaining tasks

In #1967656-9: Add views support @hanoii suggested we also provide an update_hook:

(...) there should be an upgrade code that will change the formatters of the current image field with caption so that the people updating the module (eventually) should still see the same behavior as they had when the installed the module.

I'm not sure what to to do about this, since other modules (views or panels for example) can also have image fields using the default formatter. Should we attempt to upgrade only content type display settings and add a note about manually changing the others?

User interface changes

The site builder should now explicitly select the Image with caption formatter in order to have today's default behaviour.

Feature request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇦🇷Argentina mpv

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