Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rlnorthcutt opened this issue Jul 24, 2019 · 6 comments
Open

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

rlnorthcutt opened this issue Jul 24, 2019 · 6 comments

Comments

@rlnorthcutt
Copy link
Contributor

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.

  • For the title, if its not filled out already, use the filename (cute-cat.jpg)
  • For the alt text, use the filename without the extension (cute-cat)

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

@saltednut
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

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

@rlnorthcutt
Copy link
Contributor Author

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
Copy link
Contributor

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

@saltednut saltednut removed their assignment Aug 5, 2019
@saltednut saltednut self-assigned this Aug 15, 2019
@saltednut saltednut removed this from the 19Q3 DF4 alpha3 milestone Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants