decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

Add option for the image widget to return object instead of URL

Open martinjagodic opened this issue 7 months ago • 0 comments

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

{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

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

martinjagodic avatar Nov 29 '23 12:11 martinjagodic