acquia / df

Demo Framework - mirrored at https://git.drupal.org/project/df.git
https://www.drupal.org/project/df
18 stars 19 forks source link

Auto-generate default field text for image media uploads #132

Open rlnorthcutt opened 5 years ago

rlnorthcutt commented 5 years ago

When adding image media, we should use the filename to pre-populate text fields as possible. This way, an SA can upload/add an image, and then click save - the default fields are filled out and its much faster/simpler.

Can we pull any additional metadata (like tags) for the Unsplash integration?

saltednut commented 5 years ago

The unsplash "integration" just pulls the file from source.unsplash.com - no payload coming through with additional info, just the raw file. It may have exif info but that might vary from image to image.

rlnorthcutt commented 5 years ago

I was thinking of uploaded files. Even with unsplash integration, we still need to upload images for custom demos.

I assume that getting some data from unsplash from the API is possible, but would be another ticket.

saltednut commented 5 years ago

For the Title part, that field in the media world is called "Name" - so names in media are analogous to titles in nodes. They're the label.

Some ideas: Fancy type of ajax that updates the field post-image upload? OR We hide the title and set it automatically always based on the filename? OR We could just make the label optional via hook_form_alter and then, populate it during hook_entity_presave?

saltednut commented 5 years ago

We still don't have an agreed upon solution for auto-populating the title. Its a required field at the moment.

rlnorthcutt commented 5 years ago

I like option 1 (fancy ajax) best. I thought Sam had done something like this before in DF, but we lost it or got rid of it at some point. Does that sound familiar?

saltednut commented 5 years ago

I'm not familiar with anything like that in DF before so this would be something new?