Open jeherve opened 3 years ago
In general for something like this I'd always trail Core's decisions, as the block should feel as if Gutenberg native, and thus match the user expectations.
As for the position, it's a difficult choice. Outside it breaks the overall layout, inside it covers the image. So I don't think there's in general a "better" solution.
As the photographer who left the comment that Jeremy referenced, I'd like to add a few thoughts:
I circumvent all these problems by using a single-column gallery with large or original images in the Classic Editor. The photos are big and beautiful on desktop devices, the display is mobile friendly, the captions are legible, no part of the image is obscured, and it's extremely fast and easy to put these together. Example:
https://www.alex-kunz.com/del-dios-highlands-dawn/
I'm just one guy of course but the Gutenberg gallery block's captions are one of the MAIN reasons why I prefer the Classic Editor.
The screenshots below illustrate these problems. These aren't some "Test 1-2-3" captions, these are real-world examples that photographers and editors use. They're not titles - they're long-form text with short sentences, relevant to the image, and important for search engines.
Screenshot 1: gallery captions cover most of the thumbnail. This is on a 27" iMac:
Screenshot 2: same gallery but on my iPhone - captions obscure some thumbnails entirely, other captions are truncated. This just doesn't make any sense, I'm sorry...
Thanks for taking these thoughts into consideration.
In general for something like this I'd always trail Core's decisions
That was my initial thought as well. It seems there are discussions happening on this topic already:
So it turns out that this has been discussed since 2018. That's not very encouraging.
WordPress/gutenberg#8030
Ah yes, good find!
This was also suggested here: https://wordpress.org/support/topic/jetpack-slideshow-caption-control/
Any progress on the caption control? Looking to reposition the caption into a seperate column to the right of the image.
Hi all, Newspack team here - we've had Carolina Public Press request this same feature in Slack, so I wanted to offer that information for consideration.
Hey @jeherve, 👋
We are encountering this issue quite often. I have not found any good workaround with WP core functions. The slideshow size is calculated by the size of the image inside it. Since the captions are meant to be positioned over the slideshow, no custom CSS will allow to display captions below the images as they will be cropped.
The resizing is happening here: https://github.com/Automattic/jetpack/blob/c8c55ffa6f5da0c099ec269e487878c6827d1c4d/projects/plugins/jetpack/extensions/blocks/slideshow/swiper-callbacks.js#L38-L60
More precisely:
const img = swiper.el.querySelector( '.swiper-slide[data-swiper-slide-index="0"] img' );
targeting the child image and not the full container.
swiper.wrapperEl.style.height = wrapperHeight;
assigning its height to the slideshow wrapper
This Javascript function seems to be used for more than just the gallery slideshow.
Do you think there is an opportunity to refactor the code to use the container size instead of the child image? It would allow more room for CSS customization.
If there is anything I do to help move this issue forward, let me know.
When adding captions to images within a Slideshow block, the captions are displayed above the image:
While this may look good in some cases, it can also hide important parts of an image (the bottom of the image may display important information to the understanding of the image), or can go against the framing chosen by the photographer.
Maybe we could consider displaying those captions below the images instead?
Suggested here: https://jetpack.com/2021/01/12/jetpack-9-3-happy-new-year-from-jetpack/#comment-216325
Of note, this also applies to captions for core galleries; it may be worth suggesting this to Core as well after our discussion here.
For reference: