-
Hey, you can simplify this by using repeater onItemReady*
-
Which will run for every container with two arguments*
-
$item => simillar $w but this selector select one of the repeater element $item(“text1”), if the text1 is a element in the repeater*
-
onItemReady function will loop for every container in that repeater*
-
and you can use $item to select for the specific container*
-
itemData => have the current Item data for that container*
import wixWindow from 'wix-window';
const lang = wixWindow.multilingual.currentLanguage;
$w.onReady(function () {
$w("#dynamicDataset").onReady(() => {
$w('#repeater').onItemReady(($item, itemData) => {
let description = itemData[lang === "es" ? "description_es" : "description_fr"];
console.log({ description, itemData });
$item('#text1').text = description;
});
});
});