Hi I am using dynamic page in wix to show projects.
In the content manager I have set up a media gallery with a field name, to project a section of items on some of the project pages, however the field name still appears even though the photo gallery is empty.
Does anyone know how to make a conditional code for the field name of the photo gallery of dynamic pages? or if there is any other better solution?
A dynamic-page show 1-item only.
$w.onReady(()=>{
$w('#dynamicDataset').onReady(()=>{
let curItem = $w('#dynamicDataset').getCurrentItem();
console.log(curItem);
console.log(curItem.title);
console.log(curItem._id);
if (curItem['myFieldIDhere']) {
console.log("Field does have some value!");
//What to do now?
//Showing some elements on your page, maybe?
}
else {
console.log("Field doesn't have any value!");
//What to do now?
//Hiding some elements now on your page, maybe?
}
});
});