butterbean
butterbean copied to clipboard
Other media controls
Right now, there's an image control, but I'd like to experiment with some other media controls. I haven't worked too much with wp.media
. I'd love to see some examples from other plugins and how they're using media modals.
Anyway, this is just a general ticket for additional media controls.
The current media control seems to be for images only. A file upload or general upload would be nice.
Also thinking a multiple image or gallery control would be cool. Could be used for sliders and such.
Also thinking a multiple image or gallery control would be cool. Could be used for sliders and such.
I agree with @m-e-h, it'd be cool if you add multiple image control.
I was thinking about image gallery too. I've been thinking about how the UI would look. Maybe showing all the thumbnails in the meta box (could be a lot of images)? A placeholder?
The UI is probably the only "roadblock" that I can think of. Most of the code should be relatively easy.
Didn't think about the UI. That could get ugly with a lot of images. A preview would be nice though..
Simplest thing would be to decide on a reasonable max-height
and do overflow-y: auto
.
That's a screenshot of the WP visual editor while it's loading gallery images. It, of course, displays all the images once they're loaded. Anyway, it might come in handy.
There's also the question of whether this should be a "gallery" control or a "multi-image" control.
For a gallery, I'd probably want to store something like the [gallery]
shortcode parameters such as columns
, etc.
So, I'm leaning more toward a multi-image control that gives you an array of image IDs. Then, let developers extend that for a more specific use case like a full gallery implementation.
Still undecided though. I'd need to dig into the core media modal stuff more to see exactly what's available.
Here're a couple screenshots from Advanced Custom Fields Pro plugin gallery modules
Exactly like @m-e-h said, use max-height
and overflow: auto;
Stumbled upon this the other day https://make.xwp.co/2016/08/12/image-gallery-control-for-the-customizer/ Haven't tried that control yet but thought it may be a relevant reference for a Butterbean gallery control.