Lightbox - making sure the next / prev arrows work correctly in preview

Just a helpful tip which I just found out: I’m building portfolio pages. On every page there is a “lightbox photo gallery” which I build by adding 4 thumbnails in a 4 column row, then setting the interaction of each one to lightbox. Blocs adds a name for the gallery like “gallery-1”.

When previewing the gallery, the previous & next arrows weren’t cycling through the images quite right.

I found out that if I give each gallery a unique name (Mercedes, Audi, Porsche etc.) the previous / next arrows work fine. I my browser got confused because all galleries on all pages had the same name (Gallery-1)

I don’t quite see what the problem is/was. The whole idea behind naming galleries is to allow a number of different galleries on the same page. I’m guessing that is what you were attempting to do. eg, have a different gallery for Mercedes, Audi, Porsche etc. In which case, the normal procedure is to assign each image to a particular gallery e.g. gallery-1, gallery-2, gallery-3 etc, or even give the galleries names that reflect their content such as mercedes, audi. porsche etc.

1 Like

I guess you misunderstood me. I wasn’t reporting a problem. I only wanted to share something I found out.

Ok, understood. I thought you were reporting a workaround for something that wasn’t working as it should. Sorry for the misunderstanding.