Hi everyone,
I'm trying to hide a gallery when it's not valued in the dataset. Below is the code that still does not work. Can you please help me?
Thanks in advance, as always
$w("#DDTS1").onReady(function () {
var pageGallery = $w('#DDTS1').getCurrentItem();
if (pageGallery["galleryProduct"] === undefined) {
$w('#gallery1').collapse();
$w('#gallery1').hide();
}
});
As it is a bit complicated to understand your collection structure without seeing it, I assume ta you have a field key called "galleryProduct" that contains the images.
If this is the case, then in order to call to this specific field you'll need to have something like this instead of putting it into square brackets:
pageGallery.galleryProduct === undefined