So I have a page and it has like 3 images and 1 video.
I should display the video only of the Url is there in Database.
Similarly, I should display Images 2 and 3 only when they are present.
If not I need the area to be collapsed, right now I see a blank space and that isnt helping.
I tried changing the code but nothing helped
1 Like
Well i made it to work
$w.onReady(() => {
$w(β#dynamicDatasetβ).onReady(() => {
// Checks if the img2 is null and displays only when its there.
if(!($w(β#dynamicDatasetβ).getCurrentItem().img2)){
$w(β#image2β).collapse();
$w(β#image2β).hide();
}
// Checks if the img3 null and displaysonly when its there.
if(!($w(β#dynamicDatasetβ).getCurrentItem().img3)){
console.log(βInside here5β);
$w(β#image3β).collapse();
$w(β#image3β).hide();
}
// Checks if the tube video is null and displays only when its there.
if(!($w(β#dynamicDatasetβ).getCurrentItem().tube)){
$w(β#videoPlayer1β).collapse();
$w(β#videoPlayer1β).hide();
}
});
});
Good job