Skip to content

Add file widget as secondary type for the image field inference #5317

@corbinchild

Description

@corbinchild

Is your feature request related to a problem? Please describe.
I have a thumbnail field that can be an image, webm, or mp4 file. Therefore, it is necessary for me to use the file widget with the name and label "thumbnail". The grid view in Netlify CMS uses field inferences to display a preview image for each item in a collection. However, the field inferences code only looks for values from the image widget, not similarly named file widgets.

Relevant code is here:
https://github.com/netlify/netlify-cms/blob/460d1e6835af122f86278b4b2f9c2e3b7bc91488/packages/netlify-cms-core/src/constants/fieldInference.tsx

Describe the solution you'd like
Perhaps the file widget can be added to 'secondaryTypes' for the image field inference. If the file widget value is a valid image path then the image should be displayed in the grid view for collections.

Metadata

Metadata

Labels

area: extensions/widgetstype: featurecode contributing to the implementation of a feature and/or user facing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions