Creating an expandable text box with a "show more..." in a Repeater

@giri-zano Sorry for that
This is from the example here https://support.wix.com/en/article/corvid-tutorial-creating-a-show-more-link
and I would like to add it in Matt’s code which works very well but does not do the check for text length. I am sure it is easy and basic but I am not a developer so I need your help.

if (!fullText) {
$w(‘#myTextElement’).collapse();
$w(‘#myButton’).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(‘#myTextElement’).text = fullText;
$w(‘#myButton’).collapse();
} else {
// create the shortened version of the text and display it in the text element
shortText = fullText.substr(0, shortTextLength) + “…”;
$w(‘#myTextElement’).text = shortText;
}
}