I have dynamic pages on my site which pull info from databases. Everything is connected properly, but sometimes the image doesn’t show the correct image, but the template’s image instead. It works most of the time, the the rep I spoke to says everything looks fine, but the only thing I can think that may be causing this is this code I have:
$w.onReady(() => {
$w(“#ComediansDataset”).onReady(() => {
// Gets the current item properties and stores them in a variable called item
const item = $w(“#ComediansDataset”).getCurrentItem();
if (!item.image1) $w(“#image3”).collapse();
if (!item.image2) $w(“#image4”).collapse();
if (!item.video) $w(“#video1”).collapse();
if (!item.paragraph) $w(“#text31”).collapse();
});
});
It’s meant to collapse items that are not in the dataset. Like I said, this works fine most of the time, but sometimes the images aren’t the correct one. The text is always fine. Any help would be greatly appreciated. Thanks