Hi Corvid Community,
On the homepage of the WIX site I help run there’s a repeater that takes information from a dataset connected to the site blog and displays it as a custom mini news feed for a specific blog category.
Part of the necessary formatting for this repeater has been implementing a character limit for both the titles of the posts and descriptions of the posts so that they maintain a standardized size on the page.
My code had been working fine for the past year and a half until this morning the code seems to have just stopped working on the live site. It weirdly still works correctly in the WIX Editor Preview Mode, and the developer console in preview doesn’t show any warnings.
But on the live site it is not restricting the length of the titles or descriptions at all.
I’ll admit I’m by no means a coding expert and have assembled the code largely by digging through the forums and learning parts of what helped me build this over time, so it may be kind of inelegant.
All of the Code for the page is as follows:
$w.onReady( () => {
$w("#dataset1").onReady( () => {
$w("#repeater1").onItemReady( ($item, itemData, index) => {
let theItem = itemData.excerpt;
var shortDescription = theItem.substr(0,140);
$item("#description").text = shortDescription + " . . . ";
});
$w("#repeater1").onItemReady( ($item, itemData, index) => {
let theTitle = itemData.title;
var shortTitle = theTitle.substr(0,70);
if (theTitle.length > 60){
$item("#title").text = shortTitle + " . . . ";
}
});
} );
} );
Thanks to anyone who can help me rectify this!