Shorten text from reference field

I’m using a dataset conected to a repeater, with the blogposts collection as a reference field .

I’m always using this or similar code to shorten text in repeaters from my blog posts, directly connected with the dataset blogposts.

Is there a way to retrieve fields like itemData.title when the blog posts are used as reference fields? How do connect to the blog collection fields? Any help is much appreciated.

$w.onReady( function () {
$w( “#dataset1” ).onReady( () => {

$w( "#Blogrepeater" ).onItemReady( ($item, itemData, index) => { 

let theItem = itemData.title;
var shortTitle = theItem.substr( 0 , 100 );
$item( “#blogtitel” ).text = shortTitle + " " ;
});
} );

Have you considered saving a 100 char shortened version of the title to the collection at the same time the blog title is created. So then the repeater field refers to this attribute for its data?

Thanks Aussie Fred!!, sounds promising, thanks for pointing me into the right direction. I 'm not a coder kind a girl, so need to dive in to this how to code this. Any suggestions would be more than welcome.

You can also check out Nayeli (Code Queen) tutorial for limiting characters in a repeater.
https://support.totallycodable.com/en/article/limit-characters-in-a-repeater-using-wix-code

Which it looks like where you have got your code from!

Also, note that there are Wix Blog examples already that you can view too.
https://www.wix.com/corvid/examples?category=blog

If your repeater is just showing Wix Blog posts, then why not just pull the data from the Wix Blog Posts collection?
https://support.wix.com/en/article/corvid-wix-blog-posts-collection-fields