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

Lightbox option for gallery block #37652

Open
matthiasballreich opened this issue Dec 29, 2021 · 16 comments
Open

Lightbox option for gallery block #37652

matthiasballreich opened this issue Dec 29, 2021 · 16 comments
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Enhancement A suggestion for improvement.

Comments

@matthiasballreich
Copy link

It would be very nice to have the Lightbox option for the gallery block. I now i can click on every single image inside the gallery block and enable there the lightbox option, but if i have many images, this ist not the best way. It would be much better to have the lightbox option for the whole gallery block.

@annezazu annezazu added [Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Enhancement A suggestion for improvement. labels Dec 29, 2021
@lwangdu
Copy link

lwangdu commented Dec 29, 2021

If there is lightbox option for the gallery block, that would be wonderful. So we don't have to install another plugin, for that reason. Thank you.

@paaljoachim
Copy link
Contributor

paaljoachim commented Aug 29, 2022

That is a very good and helpful idea!
@glendaviesnz Glen what are your thoughts around having a lightbox in the Gallery block?

@glendaviesnz
Copy link
Contributor

It has been discussed, but not sure what priority currently is, have added this issue to the gallery improvements project.

@paaljoachim
Copy link
Contributor

paaljoachim commented Aug 31, 2022

@glendaviesnz Glen. Can you add a link to the Gallery Improvements project? Thanks.

@masteradhoc
Copy link
Contributor

+1 for this enhancement

@masteradhoc
Copy link
Contributor

@paaljoachim @glendaviesnz is there any chance this gets a higher priority soon?

@paaljoachim
Copy link
Contributor

paaljoachim commented Jan 26, 2023

I will go ahead and add the "Needs Design" label to it.

@paaljoachim paaljoachim added the Needs Design Needs design efforts. label Jan 26, 2023
@rfischmann
Copy link

Now that WordPress 6.4 is out with the native lightbox option for individual images, it doesn't make any sense that it won't work for galleries as well, right?

@masteradhoc
Copy link
Contributor

@paaljoachim is there really a design needed for this?

maybe @artemiomorales or @t-hamano are able to give us an insight how much can be reused from the image component?

@paaljoachim paaljoachim removed the Needs Design Needs design efforts. label Nov 20, 2023
@paaljoachim
Copy link
Contributor

Hey @masteradhoc Brian. There is no need for a new design as the Lightbox option has been added to the Image block. I look forward to seeing this also in the Gallery block.

@glendaviesnz
Copy link
Contributor

glendaviesnz commented Nov 20, 2023

The Gallery block is essentially just a collection of Image blocks, so I think the main work here would be:

  1. Implement a way to apply the lightbox on setting to all the child images of the gallery. The gallery already does this with the linkto and resolution settings, so shouldn't be too much work
  2. Implement a carousel. I think this would be a basic expectation of users as you don't really want to be opening and closing every image in the gallery, you most likely want to page through them once the lightbox is open

@rfischmann
Copy link

2. Implement a carousel. I think this would be a basic expectation of users as you don't really want to be opening and closing every image in the gallery, you most likely want to scroll through them once the lightbox is open

There should be a visible arrow, but also keyboard support for navigation.

@t-hamano
Copy link
Contributor

Regarding this issue, I think it is necessary to consider the inheritance of lightbox.allowEditing and lightbox.enabled attributes.

Even if the Gallery Block's lightbox is controllable and enabled by default, what is the expected behavior if the Image Block's lightbox within it is disabled and is disabled by default?

For example, if theme.json is defined as follows.

{
	"$schema": "https://schemas.wp.org/trunk/theme.json",
	"version": 2,
	"settings": {
		"blocks": {
			"core/gallery": {
				"lightbox": {
					"allowEditing": true,
					"enabled": true
				}
			},
			"core/image": {
				"lightbox": {
					"allowEditing": false,
					"enabled": false
				}
			}
		}
	}
}

We may also need to consider #54858, which reports that lightbox settings do not work at the root level of theme.json.

@firepainting
Copy link

firepainting commented Nov 22, 2023

For navigation I agree on having clickable left and right arrows, and keyboard support. As a bonus, is it also possible to make images swipe-able?

This is necessary for galleries with a lot of photos. (Actually we are going to build a site just like that.)

I don't want to rely on plugins just for lightbox. I also don't need fancy ones: just enlarge an image upon click/tap; have the ability to browse the gallery by clickable arrows or swiping; and easily close it when I want. Let's leave fancy for the plugins. WordPress core must be able to do the essentials!

Thank you!

Edit: I acknowledge the "Expand on click" feature which I believe was shipped with WP 6.4.

@kauaicreative
Copy link

kauaicreative commented May 26, 2024

It would be very nice to have the Lightbox option for the gallery block. I now i can click on every single image inside the gallery block and enable there the lightbox option, but if i have many images, this ist not the best way. It would be much better to have the lightbox option for the whole gallery block.

This issue is related to the, lightbox option for the gallery block. I believe this gallery lightbox toggle was added and then removed. We need to add the option back - a toggle to open all gallery block images in the lightbox without having to click on each image individually. Or perhaps better yet, the option to select multiple images and be able to select link > open in lightbox

@paaljoachim
Copy link
Contributor

Check out this PR which adds the same Image block link feature to the Gallery block. (Also includes Expand on click - lightbox feature.)
#62762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

10 participants