-
Notifications
You must be signed in to change notification settings - Fork 8
Implement gallery widget #62
Comments
Wireframes: gallery-widget-wireframes.pdf Some remaining questions:
|
FWIW, not sure the gallery widget should show a preview within the widget box (consider also the Widgets screen in the admin). There's just not enough space 🙂 |
@afercia What about this suggestion?
|
Is there a limitation on how the widget shows the gallery? Or should it be the same as it is in a post? The answer to that might help with the questions about columns. Does the widget setup have a preview or is it standard media modal that returns parameters (like in shortcode) that are entered into the various widget fields? Within Customizer, it does not need a preview in the control panel because it would be visible in the page preview. Within the Widget page, it does not need a preview either. I can see that the Media workflow for gallery would be okay for the widget, whereas I feel it is so limiting compared to the old way for Posts. The workflow removed a bunch of options that you now have to add manually to the shortcode if you want them, and it won't even let you create a gallery for attached images. But that works in terms of the widget at least. |
As far as I currently know, there's no technical limitations. We might want to artificially create constraints based on what's a better experience, which is what we're trying to determine now as we spec out the widget.
Like the image widget, it'll rely on the media modal. I disagree that a preview is unnecessary, especially within
Which options? If they make sense in the context of a widget, we could consider adding them. |
@melchoyce not sure 🙂 maybe consider first what would be best to show. The actual images or just a representation of the gallery? In the first case, yep I guess there should be a limit since galleries can have dozens of imaged. In the second case, maybe it would be interesting to experiment how a gallery can be visually represented. |
@afercia We used to show a graphical representation (rather than the images themselves) in posts/pages, and it... really sucked. :) Previewing galleries, versus showing a placeholder graphic, made galleries way, way better to work with IMO. |
@melchoyce @afercia there is some prior work done (by @miina) on such a customizer gallery control with a preview: https://make.xwp.co/2016/08/12/image-gallery-control-for-the-customizer/ A couple screenshots: |
If someone only adds one image to their gallery, let's display it full-width like the regular image widget. |
Wouldn't that depend on the other choices they made, such as size (thumbnail, medium)? |
Sorry, yes. I was trying to say if someone chooses only one image for their gallery, that image should display inside the gallery widget like the image widget, but I communicated that poorly. |
I think the media modal is the best preview for
You can see all the options for the shortcode in the codex. I used to use the |
@melchoyce the one with a limit to 5 plus the |
If you have a couple gallery widgets, having a preview to distinguish them from each other is helpful. I also think previewing is always better than abstracting. |
Also take note of parallel work being done in Gutenberg on the gallery block: WordPress/gutenberg#317 |
Nice. In our Gutenberg work, I'm hoping that we can upgrade the existing [gallery] shortcode into a modern block. This remains to be seen whether is feasible or not. But blocks are the end goal here. How will widgets live in a block world? I know that's an overarching question. But if our gallery is a block, and this widget gallery becomes a block eventually, which one would you use? Not saying that one should necessarily stop the other from being worked on, perhaps they are just slightly different stylistically, and have different names? |
I don't think widgets will live in a block world — not at the end, at least. I always imagined these media widgets would be a precursor to blocks. When we work towards allowing blocks outside of |
@jasmussen another way to think of it is that Gallery widget contains a gallery. For the moment it is re-using the For the gallery widget specifically, I wanted to highlight the work being done here in relation to Gutenberg specifically to call-out what the data model looks like for the widget/block attributes. The widget and the editor block should both be able to model the same thing and ideally there should be common naming conventions, similarly to how I raised in relation to the image widget and the image block: WordPress/gutenberg#310 If we can use the same schema for the widget/block attributes, then it will make it easier for us down the road to migrate and map between the two. |
Ah, thank you for the clarification! Makes total sense now. As a sidenote, I hope my comments did not come over as doubtful of the approach in any way. My trust in this team is absolute, and the project is in great hands. |
This is an initial implementation of the enhanced widget preview design proposed in #62. See: https://cloud.githubusercontent.com/assets/2846578/25029086/e8b7efa2-2087-11e7-8ea6-43679a3a2fb8.png
The plugin with the Gallery widget auto-deployed to WordPress.org so it is now available for all to test: https://wordpress.org/plugins/wp-core-media-widgets/ |
Gallery Widget Flow
See https://core.trac.wordpress.org/ticket/41914
The text was updated successfully, but these errors were encountered: