Link to media lightbox from external site.

Hi All,

I’d appreciate if somebody can help me with next question: I’d like to give a link to my wix-site (from external source) to specific lightbox that opens when I click on slide-gallery. (I have several galleries on my page.)
Is it possible in any way?

Thanks.

Hello Anastasiya,

You can check what the previous website url was using the .referrer function. After that you can create a switch statement that opens the lightbox appropriate to its referrer.

If you run into some trouble with the code post it here.
Goodluck!
Majd

Thank a lot for getting back to me, Majd. It also great feature. But I need vise versa. I actually need to know the name of lightbox that appears when I click on my slide gallery - I don’t have anything in url, and I don’t have it in list of all light-boxes on site. Hence can not use openLightbox function. Is it any way to know it?

Hello,

When you open your light box you can pass in a data object in it with the light box name. Then in the ligthbox page you can get that data object using the .getContext() function.

For details and some common errors check this thread to see working code: https://www.wix.com/code/home/forum/community-discussion/lightbox-passing-data-to-a-page

Goodluck,
Majd

Thank you again Majd!
I’m sorry I should try to reformulate my question again - is it possible to somehow open lightbox that created automatically for Wix Pro Gallery, as I don’t create it myself and do not open, I just select “open in expend” in settings.

@sun_world it sadly seems obvious that Majd didn’t get what you’re asking…
Did you ever find the solution to how to directly link to a lightbox?

@experimentnoxx sadly Lightboxes doesn’t have direct urls

@t8311834 You can add a url query to your link from the external site. Then, you can create some code in your site panel to open the lightbox automatically if it finds that url query:
https://www.wix.com/corvid/reference/wix-location.html#query

Did you ever get that information figured out?