Avada Forums Community Forum can I open the lightbox of a gallery with a link or a shortcode? Reply To: can I open the lightbox of a gallery with a link or a shortcode?

Michael C
Post count: 549

This depends on what exactly you mean by gallery. @berger_gds is correct in that you can open an image in that method. You can also load a gallery, but a lightbox gallery is a specific thing. If you have a Gallery Fusion Builder element on the page for example, it will be auto assigned a lightbox gallery ID which you can load from a link.

1. Find the gallery ID being used for the gallery element. To do that view the gallery on the front-end, right click on an image and inspect. You will see the link being used for the image includes the gallery ID: http://prntscr.com/jxkfxf

2. You can then copy that to a separate link. For example:

<a href="my-first-gallery-image.jpg" data-rel="iLightbox[b9e356723910aaff7cb]"> My Gallery </a>

This can also be the case for creating a separate gallery. For example:

<a href="image1.jpg" data-rel="iLightbox[mygallery]"> My Gallery </a>
<a href=""image2.jpg" data-rel="iLightbox[mygallery]"> My Gallery </a>
<a href=""image3.jpg" data-rel="iLightbox[mygallery]"> My Gallery </a>

This is three separate links to different images. However since the gallery ID part (mygallery) is the same, if you click one of these links all three images which appear in the lightbox gallery.