Question:
How can I hide fields/content in my CMS collection that I don’t need on a specific page, so there is no placeholder picture/text etc.?
Product:
Wix Studio
What have you already tried:
hiding manually, hiding in collection settings
Additional information:
The goal is that I can add content to my CMS collection and hide stuff I don’t need on my ‘projects’ page, like 3rd titles, images, etc.
Pratham
November 14, 2024, 2:57pm
2
You can achieve that with a little bit of Velo code.
Always search on the forum first for similar questions before posting your own.
I use the below example all the time.
Note the exclamation mark before currentItem, this means ‘if empty’.
Replace:
#yourDatasetID with the ID of your dynamic page dataset
databaseFeildID with the field ID in the CMS you want to check
#itemToHideID with ID of the page item you wish to hide
const currentItem = $w('#yourDatasetID').getCurrentItem();
$w.onReady(function () {
if (!currentItem.databaseFeildID) { $w("#itemToHideID").collapse(); }
});