Getting a URL Directly to a LightBox

I need a url to a lightbox that can be used outside of the wix environment. The lightbox requires an email address, which i need to know before i give access to a video.

I found a youtube video that showed adding code to accomplish this, but the code was too blury to copy and the comments made it looked like it worked for half and didn’t work for half.

YouTube reference: Wix Code Courses - Getting a Lightbox URL - YouTube

Anybody got this code or another way to do this?

thanks!!

Hello, joshdanderson.
Lightboxes doesn’t have direct urls, but you can open lightboxes on any of your pages.
The simpliest way of implementing what you want is to set one of pages for “members only”, this way only registered users will be able to access it, so you will have their email. And then to set lighbox to be opened on this page. No coding is required.

great, thank you Andrii! I’ll give it a shot. Cheers, -josh

import wixWindow from ‘wix-window’;
import wixLocation from ‘wix-location’;
function open_Lightbox(){
let query = wixLocation.query;
var goto = query.name;
wixWindow.openLightbox(goto);
}
$w.onReady(function () {
open_Lightbox();
});

add this code to your page you wnt to use it on.
Then add the url www.test.com/pagename/?name=Lightboxnam e

I hope this helps

import wixWindowFrontend from 'wix-window-frontend';
import wixLocationFrontend from 'wix-location-frontend';

function open_Lightbox() {
    let query = wixLocationFrontend.query;
    var goto = query.name;
    wixWindowFrontend.openLightbox(goto);
}

$w.onReady(function () {
    open_Lightbox();
});

:sunglasses:

the light box is a url Andrii my g, you just gotta add this code then your url + pagename + light box name