@massasalah18
I’m trying to shorten the text box within the repeater, but having issues. We don’t need the “see more” button, as we’ll link the full text to a new page.
https://www.trustscout.com/ask-a-real-estate-expert
let fullText; // variable to hold the full text let shortText; // variable to hold the short version of the text
$w(" #dynamicDataset “).onReady( function () { // how many characters to include in the shortened version const shortTextLength = 40; // set the fullText variable to be the text from the collection fullText = $w(’ #dynamicDataset ').getCurrentItem().textField; // if no text to display, collapse the text element and the button if (!fullText) { $w(” #repeater1 “).forEachItem( (’ #text349 ‘)) .collapse(); $w(’ #button69 ').collapse(); } else { // if the text has fewer or the same number of characters as shortTextLength characters, display it as is and collapse the “Show More” button if (fullText.length <= shortTextLength) { $w(” #repeater1 “).forEachItem( (’ #text349 ‘)).text = fullText; $w(’ #button69 ').collapse(); } else { // create the shortened version of the text and display it in the text element shortText = fullText.substr(0, shortTextLength) + “…”; $w(” #repeater1 ").forEachItem( (’ #text349 ')).text = shortText; } } });