I have a database that I connect the content on a dynamic page. I have 12 images that are linked individually to different fields in the database. When the field is null I get a blank space. Is there any way to eliminate this?
Full Display:
You need to tell us how the images are displayed on your actual page, have you used seperate image boxes for each pic or are you displaying them in a repeater or a gallery?
If they are in a repeater or a gallery, then they should just be shown one after another all depending on what your code returns from the filter etc.
@givemeawhiskey , Thank you once again. Yes I have each image as an individual image. I will try a container approach and let you know what happens. Bill
The easiest way to do it, is to use a repeater that contains an image place holder (and if your images have different sizes, then you’ll have to put a slider gallery instead), and do something like:
$w.onReady(function () {
$w("#dynamicDataset").onReady(() => {
let item = $w("#dynamicDataset").getCurrentItem();
let images = [item.googleMaps, item.bbbLink/*etc*/];//put all your images here
images = images.filter(e => e);//eliminate undefined values
images = images.map((e, index) => {return { _id: index.toString(), image: e};});//create array for the repeater.
$w("#repeater1").data = images;//bind the data to the repeater
$w("#repeater1").onItemReady(($i, iData, inx) => {
$i("#image1").src = iData.image;
})
})
})