I created a gallery from a dataset.I am trying to create code that will open up a lightbox whenever an item in that gallery is selected. Also I would like to know how to send text from the same dataset into the lightbox to be displayed.
Hey Kamoi
Sending text to a lightbox is done by adding it as an object to the call
Some basic code:
//Site Code
let dataObj = {
"text1": "Some Text",
"text2": variable
}
wixWindow.openLightbox("LightboxName", dataObj);
On the lightbox you would then read that with getContext()
import wixWindow from 'wix-window';
$w.onReady(function () {
let context = wixWindow.lightbox.getContext();
$w('Element').text = context.text1
$w('Element').text = context.text2
})
Thank you very much.
How do I send information from the item selected from the gallery into the lightbox. Would the getCurrentItem function work
I believe it should work