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.

Getting TruncHTML endings on the same line

September 16, 2009 7:06pm

Subscribe [2]
  • #1 / Sep 16, 2009 7:06pm

    tonyd3

    13 posts

    I’m using the trunchtml plugin and it works great, EXCEPT - I can’t seem to get the endings I specify in the tag to show up on the same line as the last line of the truncated text.  Instead they show up on the next line (line break).


    Here is my code:

    <div class="postBody">
            {exp:trunchtml chars="300" ending="... [ <a href='{path=blog/entry}'>continue reading</a> ]"} {blog_body}{/exp:trunchtml}
    </div>


    I’d like it to output like this:

    this is the last line of text… [ continue reading ]

    But instead it outputs like this (with a line break):

    this is the last line of text
    ...[ continue reading ]

  • #2 / Sep 16, 2009 7:13pm

    Focus Lab Dev Team

    1129 posts

    I think the parameter you’re looking for is “inline” and not “ending”. Give this a try:

    <div class="postBody">
            {exp:trunchtml chars="300" inline="... [ <a href='{path=blog/entry}'>continue reading</a> ]"} {blog_body}{/exp:trunchtml}
    </div>
  • #3 / Sep 16, 2009 7:17pm

    tonyd3

    13 posts

    Hmmm, I tried that and the ending just disappeared altogether.

    I was following the parameters they listed here:  http://expressionengine.com/downloads/details/trunchtml/

  • #4 / Sep 16, 2009 7:20pm

    Focus Lab Dev Team

    1129 posts

    Ah, that appears to be out of date. Check here

  • #5 / Sep 16, 2009 7:25pm

    tonyd3

    13 posts

    Sweet!  Except it doesn’t work for me for some reason - I simply replaced “ending” above with “inline” and the whole thing just disappears for some reason…?

  • #6 / Sep 16, 2009 7:27pm

    tonyd3

    13 posts

    Perhaps I have the older version installed - I bet that’s it.  DOH!

  • #7 / Sep 16, 2009 7:27pm

    Focus Lab Dev Team

    1129 posts

    Sweet!  Except it doesn’t work for me for some reason - I simply replaced “ending” above with “inline” and the whole thing just disappears for some reason…?

    Are you running the latest version?

  • #8 / Sep 16, 2009 7:28pm

    Focus Lab Dev Team

    1129 posts

    Perhaps I have the older version installed - I bet that’s it.  DOH!

    Haha, yea it should work. Hopefully it’s solved 😊

  • #9 / Sep 16, 2009 7:43pm

    tonyd3

    13 posts

    Problem most definately solved!  Thank you so much for the link Erik, I was about to start pulling out my hair.  😊

  • #10 / Sep 16, 2009 7:46pm

    Focus Lab Dev Team

    1129 posts

    Awesome! Glad to help 😊

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

ExpressionEngine News!

#eecms, #events, #releases