Ok thanks, got this working.
Now I’m trying to open a Lightbox Dynamically
Depending on the record in the database. In d=the database there’s a field lightbox, where I have filled in the name of the Lightbox. But this doesn’t work yet ![]()
Any idea pls?
import wixData from ‘wix-data’ ;
import wixWindow from “wix-window” ;
import {local} from ‘wix-storage’ ;
/*
$w.onReady(function () {
$w(‘#button8’).onClick((event)=>{
wixWindow.openLightbox(‘HRM Coaching’)
});
*/
$w.onReady( function () {
let dienst = local.getItem( ‘#projectname2’ );
console.log(dienst)
wixData.query( “Projects” )
.eq( “title” , dienst)
.find()
.then(results => {
let items = results.items;
let firstItem = items[ 0 ];
$w(#button8).onClick((event)=>{
wixWindow.openLightbox(firstItem.lightbox);
});
});
});