Hi there I do something similar on my site. It looks like you aren’t setting the elements to display what you want them to. Below is the code I use (of course, change the element IDs to match yours) , and the Lightbox code shows you how to connect the elements to your database field keys .
import wixWindow from 'wix-window';
$w.onReady(() => {
let receivedData = wixWindow.lightbox.getContext();
$w("#yourText").text = receivedData.name; // "name" is the field key
$w("#gallery").items = receivedData.images; // "images" is the field key
$w("#anotherText").text = receivedData.price; // "price" is the field key
// etc, connect all relevant elements
});
@nanami Are you testing in preview or on the live site? I get the same “error” in preview mode but everything still works fine on the live site, with no error.
Also, if the elements on your Lightbox are connected to the database, you should disconnect them. Because we are filling the items using code. Otherwise it will always show the first item.
Hi. @LMeyer, Highly appreceated and thanks. I am stuck on something while trying your code. Can you please explain in this part → wixWindow . openLightbox ( “Name of Lightbox” , repeaterItem ); ← what repeaterItem means? What to exactly put there? plz help.