Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.58k stars 797 forks source link

Slideshow Block: consider displaying captions below the images #18324

Open jeherve opened 3 years ago

jeherve commented 3 years ago

When adding captions to images within a Slideshow block, the captions are displayed above the image:

jetpack-slideshow

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:

image

folletto commented 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.

antermoia commented 3 years ago

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:

Screen Shot 2021-01-13 at 9 18 46 AM

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...

IMG_3326

Thanks for taking these thoughts into consideration.

jeherve commented 3 years ago

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:

antermoia commented 3 years ago

So it turns out that this has been discussed since 2018. That's not very encouraging.

https://github.com/WordPress/gutenberg/issues/8030

jeherve commented 3 years ago

WordPress/gutenberg#8030

Ah yes, good find!

jeherve commented 3 years ago

This was also suggested here: https://wordpress.org/support/topic/jetpack-slideshow-caption-control/

braddalton commented 2 years ago

Any progress on the caption control? Looking to reposition the caption into a seperate column to the right of the image.

shelb-elliott commented 1 year ago

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.

geoffguillain commented 10 months ago

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.