I would rather only show a certain number of characters, or a number of paragraphs instead of just slicing the div to a fixed size because doing so would slice some of the paragraphs right through the middle.
As hilarious as it sounds, this screws up part of the layout on only SOME of the posts. However, it keeps the links but I have noticed it is limited to just over 2000 characters. Also, some blog posts don't get the "..." at the end as they should.
As you can see, the bottom of the first post is ruined, the second post looks well but the third one is missing the "...". Still, these dots are not important to me, I have to add a span with the link to the full blog post anyways.
Should the be any images on the list of blogposts, or do you just want clear text.
If you have to show some images to to the blogpost I wouldsuggest you to lookhere at Lee KelleherĀ“s answer or some other of the anwsers, it might help you
XSLT string limit
I would like to only show a part of the blog posts on my blogs homepage.
RIght now I use this to show the whole content of the blog post:
I would rather only show a certain number of characters, or a number of paragraphs instead of just slicing the div to a fixed size because doing so would slice some of the paragraphs right through the middle.
Thanks!
Try Truncate
Works, but it removes any image or link from the text. Any way around this?
Try this one:
/Dennis
As hilarious as it sounds, this screws up part of the layout on only SOME of the posts. However, it keeps the links but I have noticed it is limited to just over 2000 characters. Also, some blog posts don't get the "..." at the end as they should.
As you can see, the bottom of the first post is ruined, the second post looks well but the third one is missing the "...". Still, these dots are not important to me, I have to add a span with the link to the full blog post anyways.
Sorry, you can disregard the previous post. It was a CSS issue. I forgot to turn off the overflow and the max-height that I had previously been using.
Thank you guys!
Actually no, it isn't it still messes up.....
Hi Alexandru,
Should the be any images on the list of blogposts, or do you just want clear text.
If you have to show some images to to the blogpost I would suggest you to look here at Lee KelleherĀ“s answer or some other of the anwsers, it might help you
http://our.umbraco.org/forum/developers/xslt/32242-TruncateString-breaks-html-%28bug%29?p=1#comment118712
/Dennis
Yeah, what he says makes sense. I will dig into it and get back with an answer. cheers!
I can't download the code files that he suggests. I have sent him a message, hopefully he will reply. Thanks for pointing him out to me!
is working on a reply...