Use modal like a lightbox

Hi there, I have this setup:

Its looping in an acf gallery.

Is there a way to do the same, but without using acf pro? so for example, have a grid of images, and if you click on one of the image, it opens a modal, with the same image inside? like how a lightbox would behave?

Thanks.

Hi Oriol,

Thanks for reaching out.
You can use the Envira Gallery a bundled plugin that comes with the Theme. Please go through the following articles.

Hope it helps.
Thanks

I know I can :slight_smile: but that wasn’t my question…the Envira plugin adds a lot of scripts to my site, I want it to be more streamlined, hence my question.

Hello Oriol,

In case you want to lightbox image I would suggest you please add the image element inside the grid cell. Added a custom class on the Image Element —>Customize —>Class

You need to add an image enable the link option and add the image URL for the Lightbox

Now you need to add the same image class to your selector shortcode and add this shortcode in the Raw Content element.

[lightbox selector=".image_lightbox"]

About-The-Tests-Page-Cornerstone (10)
Test-Page-Builder-Pro (15)

Hope it helps
Thanks

Thanks. I have worked it out using the modal method, you can see in the top gallery here:

https://www.logoglo.com/home-gallery-temp/

The bottom one is using your lightbox method, it kinda works, but the lightbox is glitchy, no previous and next buttons, and the image isnt centered in the lightbox…any ideas on how to modify the lightbox to work a little better?

Hello @Oriol,

Thanks for writing in!

The image is centered on my end. I am seeing this:

Hope this helps.

Yeha, that’s my lightbox using the modal, I was asking about the light box solution provided by Prakash, the lightbox is very wonky

Hello @Oriol,

The lightbox shortcode provided by @Prakash_s is part of the classic Cornerstone shortcodes. It is wonky and has not been updated to work with the most latest browsers.

Cheers.

Its a shame, lightbox, or similar should be included, people still use them :smiley:

Yes, that is true.
Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.