I have a dynamic page that displays text, image, and video.
I would like to hide the entire strip that contains the video,
if there is no video url(youtube) on my data set.
why is below code not working? somebody please help ![:sob: :sob:](/images/emoji/google_classic/sob.png?v=12)
$w.onReady(function () {
$w("#dynamicDataset").onReady(() => {
var item = $w("#dynamicDataset").getCurrentItem();
if (currentItem.video) {
$w("#columnStrip1").expand();
} else {
$w("#columnStrip1").collapse();
}
});
});
$w.onReady(()=>{console.log("Page is ready!");
$w("#dynamicDataset").onReady(()=>{console.log("Dynamic-Dataset is ready!");
var currentItem = $w("#dynamicDataset").getCurrentItem(); console.log("Current-Item: ", currentItem);
if (currentItem.video) {console.log("IF-Statement running!"), $w("#columnStrip1").expand();}
else {console.log("ELSE-Statement running!"), $w("#columnStrip1").collapse(); }
});
});
@dahlia907
$w.onReady(()=>{
$w("#dynamicDataset").onReady(async()=>{
var currentItem = $w("#dynamicDataset").getCurrentItem();
if (currentItem.video && currentItem.video2) {
$w("#columnStrip1").expand();
$w("#columnStrip1").show('slide', {duration500});
}
else {
await $w("#columnStrip1").hide('slide', {duration500});
$w("#columnStrip1").collapse();
}
});
});
With some additional stuff for the —> Cat! Let’s dance!
![](https://us1.discourse-cdn.com/wix/original/3X/7/e/7ef55929a8e22e08d54e93c57d09b07914894175.gif)
Hi Lamy,
This question has been asked hundreds if not thousands, you should have searched the forum first.