Hello everyone,
I am trying to display a label (svg or png) in a repeater that is connected to a data collection in CMS. However, the label should only be displayed when the boolean value is true in the connected data collection. I tried to solve it with the following code, but it didn’t work. Has anyone had a similar issue or knows how to solve it?
Thaaank you so much for any kind of help.
This is the code I tried to use:
$w.onReady(function () {
$w(“#repeater1”).onItemReady(($item, itemData, index) => {
const shouldShow = itemData.showgraphic; // field key from your dataset
if (shouldShow) {
$item("#vectorImage8").show();
$item("#vectorImage8").expand();
} else {
$item("#vectorImage8").hide();
$item(“#vectorImage8”).collapse();
}
});
});