ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Limiting {body} characters when pulling from forum post

December 19, 2010 3:23am

Subscribe [4]
  • #1 / Dec 19, 2010 3:23am

    creativesherpa

    42 posts

    Is there a way to limit the number of characters displayed when pulling from the {body} from a recent forum post?

    For example, if the post had 300 characters but when displaying the body in a non-forum template I only want to display the first 100 characters.

    Not sure how to go about doing this.

    Thanks you

  • #2 / Dec 20, 2010 8:40am

    Sue Crocker

    26054 posts

    I haven’t had a chance to try it, but how about using one of the available text truncating plugins?  Look on Devot-ee.com for one that might work.

  • #3 / Dec 20, 2010 2:34pm

    creativesherpa

    42 posts

    Thanks Sue. I was hoping that there was an EE tag I wasn’t aware of but I’ll give this a shot as well as looking at some jQuery options.

  • #4 / Dec 21, 2010 4:47am

    John Henry Donovan

    12339 posts

    Grand. Let us know how you get on with this

  • #5 / Dec 23, 2010 6:00pm

    creativesherpa

    42 posts

    success!

    okay. so if anyone else happens to need this function this is what I did.

    First I went to devot-ee and searched under the “truncate” tag
    http://devot-ee.com/search/tags/tag/truncate/

    I tried two plugins
    The first was truncHTML
    http://devot-ee.com/add-ons/trunchtml/
    worked great but it was missing [at the time of this post] a feature that I needed.

    I needed the ability to truncate at the last complete word so the character limit didn’t cut off a word if it reached its limit.

    I gave Power Truncate a try
    http://devot-ee.com/add-ons/power-truncate/

    and it worked like a dream and was easy peasy to set-up.

    EE + plugins save the day!

  • #6 / Dec 27, 2010 1:55pm

    Brandon Jones

    5500 posts

    Awesome, creativesherpa, and thanks for sharing your experience. Glad you found a solution!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases