Allow image field types to use the GenericFileFormatter

Created on 5 April 2017, over 7 years ago
Updated 1 August 2024, 4 months ago

Problem/Motivation

Currently there is no FieldFormatter for the image type which displays like the Generic File format. This is useful if a site builder wants to display any file or image field consistently as links with file icons.

Their might be concerns with overloading this class with too much functionality but it seems as if the use case is similar enough to create it in this component.

Steps to reproduce

1. Add an image and a file field to a node.
2. Add a node and upload an image and a file.
3. Configure the displays of the Image and File field to "Generic file".

-OR-

1. Enable the Media module with Image and Document Media Types (default).
2. Add a Media Entity Reference field with unlimited cardinality to a node that allows images and documents.
3. Create a node and upload both an image and a document.
4. Try to configure the node to display a list of download links for both the image and file similar to either Generic File or Download Table that is available for File fields.

Proposed resolution

Allows image field type to use GenericFileFormatter by adjusting the annotation.

Remaining tasks

  • Needs tests
  • Their might be concerns with overloading this class with too much functionality but it seems as if the use case is similar enough to create it in this component.
  • Release notes snippet

User interface changes

Site builders have a new option when configuring the display for image fields on entities such as Users, Nodes and Media (Image) by default.

API changes

None.

Data model changes

Annotation change would not cause any existing entity view display entities to change.

Release notes snippet

โœจ Feature request
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
File systemย  โ†’

Last updated about 11 hours ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States richard.c.allen2386

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Missing content requested by

๐Ÿ‡ฆ๐Ÿ‡บAustralia dpi
about 1 year ago
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024