I want to show the first sentences of my story in repeater items. But when I attach the text to database, it will show all of the words in repeater. I hope it can only show the beginning of the story as abstract and end with “…” in a stable text box.
Any suggestion or tips would be really helpful!
Cheers!
Junwei
See the article: Wix Code: How to Format Dates
To control what is displayed in a Repeater, you can use the onItemReady() or the forEachItem() functions. You can limit the size of the text that you set to the text box.
$w(“#repeater1”).forEachItem(($w) => {
let originalDate = $w(“#repeater1DateText”).text;
let newDate = originalDate.split(’ ‘).splice(1, 3).join(’ ‘);
$w(’#repeater1DateText’).text = newDate;
})
Thank you very much, your code works 