Hey guys, is there an Option so I can decide which dynamic Page layout I use for each row of my Content Manager?
I’m using the Content Manager for my Portfolio.
I have a list of my projects inside the CM - some of the Projects use videos inside the Layout, some not. Now I created two Dynamic Pages Designs one with Video Option, one without.
Now I only need to let me CM know which project row uses the to be defined Dynamic Page Layout.
I really need that option urgently.
thanksss
@christophstrohfeld It might be simpler to use a single dynamic page design that includes the video player and then collapse / expand the player depending on whether or not a particular record includes a video.
We had a similar requirement recently, and that’s what worked for us.
Before I tried it, I posted about it to see if anyone had a better approach. Here’s my post: https://www.editorxcommunity.com/forum/general-discussions/optional-video-player-on-a-dynamic-page
Below is the Velo code we used (you can ignore the console.log comments – that was just for testing).
It gets the current record (getCurrentItem) in the page’s dataset (named ‘dynamicDataset’) and checks a boolean field (showVideo) to determine whether to make the video player visible (expand). The default status of the video player is ‘collapsed’, so it won’t show unless the code causes it to show.
$w . onReady ( function () {
$w ( ‘#dynamicDataset’ ). onReady (()=>{
if ( $w ( ‘#dynamicDataset’ ). getCurrentItem (). showVideo ) {
$w ( “#videoBox” ). expand ();
console . log ( ‘It should show’ );
} else {
console . log ( ‘It should NOT show’ ) ;
}
})
});
Hey, thanks a lot for sending that code! That looks great! Wish Wix would offer a default option for that.
Thanks though, really appreciate your help!