Dynamic Page Hidden Video on some pages

Hi Everyone

I have a dynamic page for musicians that links to a database. Each page is a different musician by name - however on some pages I would like to have a video available (video is saved in dataset). However, I would like this video to only appear on the pages that a video file is saved to in the database.

Please help!

You can do something like this under the dynamicDataset’s onReady function:

let itemObj = $w("#dynamicDataset").getCurrentItem();

if(itemObj.videoUrl.length > 0) {
    $w("#videoElement").show();
}
1 Like

Hi Shan, Thank you for this code. Very helpful!

I would like to have the video player hidden on other pages where a video file is not found in the dataset. Could you please advise on how this would be possible to hide the video?

Thanks again!

If you set your video to hidden on load in the properties panel, Shan’s code will do just that.