nickyates
12 years agoMentor
how do i truncate an article body
I would like to truncate the text in the body of a blog article. I have used the freemarker substring function to do this however if any styling is added to the blog body text the closing tags are lost and the page looks broken. Is there any way to truncate this text without losing the formatting?
I found the answer here http://lithosphere.lithium.com/t5/support-knowledge-base/Character-truncation-variables/ta-p/38324 and used the following which worked perfectly.
${utils.html.truncate(10,variable_name, "...")}