Lightbox triggered for non-members

How do you trigger a lightbox for non-members/not signed in members of my website on specific pages? I do not want this lightbox to show up for logged in members. Thanks

Hey Brett,

You can check if a user is logged in or not by using the wix-user.currentUser API . Then, if the user is not logged in, you can open the lightbox.

Good luck,

Yisrael

I need this for my side. Can you give me an example of this? or code please.

@pasymartcare , See the wix-users.User.loggedIn API and openLightbox() . You want to do something like this:

let user = wixUsers.currentUser;
if(user.loggedIn === true) {
    wixWindow.openLightbox("LightboxName");
}

@yisrael-wix , I need this. Thanks Its working correctly.

Hi, I’ve been trying to do the same but is not working. Basically I have one page where I want my Lightbox to be triggered automatically if the user is not a member or not logged In I reviews the API and tried with your example but is not working

I’m using this as code (well, the last I’m trying)

I am working on a chamber of commerce page and offer an expanded member info page when the repeater image is clicked. Problem is that even if there is no image for the non-member, it still opens to the expanded page.

I want to open a light box when a non-members image is clicked, this way I can perhaps motivate non-members to get a membership.

I have a boolean field for members (checkmarked) and non-members (no checkmark)