Add file widget as secondary type for the image field inference #5317
Labels
area: extensions/widgets
good first issue
type: feature
code contributing to the implementation of a feature and/or user facing functionality
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.
The text was updated successfully, but these errors were encountered: