Is it possible to set the lightbox exclusively for members who have a certain role. If so, an exact code would be very nice.
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
Yes. First go to the lightbox settings and turn off the automatic popping up.
On the page from which you want to trigger the lightbox, use code like:
import wixWindow from 'wix-window'; import wixUsers from 'wix-users'; let rolesForLightbox = ['Seller', 'Writer',/*any role*/]; let user = wixUsers.currentUser; $w.onReady(() => { let showLightbox = false; user.getRoles() .then(r => { rolesForLightbox.forEach(e => if(r.some(i => e === i.name)){ showLightbox = true; } }) if(showLightbox){ wixWindow.openLightbox('LightboxName'); } }) })