I’ve carried on trying to solve this problem while waiting for a response but no luck on either front. Could someone please help?:
I’m very new to WIX and every line of code i write fails, until I google why and find an explanation. I can’t find an explanation for this though
I’m trying to highlight the next 3 high value events from a database collection of events. I get my results OK but cannot populate the fields in my slideshow. Here is the code I am running:
let today = new Date()
let promotionquery = wixData.query(“Event”)
.ge(“eventDate”, today)
.eq(“promote”, true )
.ascending(“eventDate”)
.limit(3)
.find()
.then( (results) => {
console.log(results.items);
if (results.items.length > 0) {
$w(“#slideshow1”).show;
let items = results.items;
let firstItem = items[0];
let totalCount = results.totalCount;
let pageSize = results.pageSize;
let currentPage = results.currentPage;
let totalPages = results.totalPages;
let hasNext = results.hasNext();
let hasPrev = results.hasPrev();
let length = results.length;
let query = results.query;
console.log(items[0].FormattedDate);
console.log(items[0].image);
console.log($w(“#text43”).text)
$w("#text43").text === items[0].FormattedDate;
$w("#image1").src === items[0].image;
$w("#text44").text === items[0].title;
$w("#text45").text === items[0].speaker;
$w("#text46").text === items[0].longDescription;
} **else** {
$w("#slideshow1").hide;
}
} );
});
The first log shows the Formatted date from the first of 3 query items returned
The second shows an image path from the same row of the same table
The third shows what is currently in the test field I want to update.
The statements assigning values to the 5 fields in the first slide of the slideshow are doing nothing but they aren’t reporting an error either. Can someone tell me how to code a slideshow from a query please?