Add option for the image widget to return object instead of URL
- 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.**
The image widget returns a string (URL) or an array of strings if `multiple: true`. On Cloudinary you can have much more data from that image, but we can't get that to the CMS.
**Describe the solution you'd like**
I would like to see an option to return an object that would return also some metadata about the image. I am mostly interested in alt and title, but other fields could be added too.
Example
```yaml
{label: Featured Image, name: image, widget: image, media_library: {config: {
multiple: true,
return_object: true
}}},
```
another option would be to add more control - let's say we define an array of fields that we want returned
```yaml
{label: Featured Image, name: image, widget: image, media_library: {config: {
return_fields: [url, title, alt, created_at]
}}},
```
**Describe alternatives you've considered**
Now you have to create your own object with alt and title fields, and that could mean double work and double data.
Contributor guide
Assessment
This issue has not been assessed yet.