let fullText; // variable to hold the full text
let shortText; // variable to hold the short version of the text
$w(“#dataset1”).onReady( function () {
// how many characters to include in the shortened version
const shortTextLength = 500;
// set the fullText variable to be the text from the collection
fullText = $w(‘#dataset1’).getCurrentItem().description;
// if no text to display, collapse the text element and the button
if (!fullText) {
$w(‘#gamedescription’).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(‘#gamedescription’).text = fullText;
} else {
// create the shortened version of the text and display it in the text element
shortText = fullText.substr(0, shortTextLength) + “…”;
$w(‘#gamedescription’).text = shortText;
}
}
});
// how many characters to include in the shortened version const shortTextLength = 500;
fullText = itemdata.description;
if (fullText <= shortTextLength) {
$w(‘#gamedescription’).text = itemData.description;
} **else** {
// create the shortened version of the text and display it in the text element
shortText = fullText.substr(0, shortTextLength) + “…”;
$w(‘#gamedescription’).text = shortText;
Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor.Please include the name of the page involved.