decaporg / decaporg/decap-cms

Add file widget as secondary type for the image field inference

Open
#5,317 2 comments 0 reactions 1 assignee Claimed by @bhanudatsinhjhala View on GitHub
area: extensions/widgets type: feature
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.