Hi all,
I’ve got a CMS case study. Each case study has a series of text fields and rich text fields. For a couple of the case studies, some of the fields aren’t relevant. Can anyone let me know how I hide the field if there is no content?
Thanks
Hi all,
I’ve got a CMS case study. Each case study has a series of text fields and rich text fields. For a couple of the case studies, some of the fields aren’t relevant. Can anyone let me know how I hide the field if there is no content?
Thanks
Of course, that’d depend on your usage though, are those case studies in a repeater? A dynamic page? Something else?
$w('#caseStudiesRepeater').onItemReady(($item, data) => {
if (!data.textField) $item('#textField').hide() // or .collapse()
})
const dataset = $w('#caseStudiesDataset')
dataset.onReady(() => {
const item = dataset.getCurrentItem()
if (!item.textField) $w('#textField').hide() // or .collpase()
})
This should givwe you a general outline of the functionality