Search code examples
phpcontent-management-systemexpressionenginetrim

Trim/excerpt content in expressionengine


Just installed EE everything seems clear however I can't seem to find a solution to automatically trim body text to say 50 characters long, is there a built in function to do this or a plugin?

Done a fair bit of searching to no avail, there seemed to be a plugin called EETrim which is no longer supported which leads me to believe it was maybe shipped with the latest version of EE however I can't find any documentation.


Solution

  • TruncHTML is one of the best ones (as it automatically handles closing of html tags): http://utilitees.de/ee.php/trunchtml

    Example:

    {exp:trunchtml chars="50" inline="..." ending="<a href='{path=site/comments}'>read on</a>"}
    {body}
    {/exp:trunchtml}
    

    http://www.devot-ee.com is always your best friend when searching for EE add-ons :)