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 plug-in to work

June 21, 2008 8:10pm

Subscribe [4]
  • #1 / Jun 21, 2008 8:10pm

    susansan

    75 posts

    I’m trying to use the trunchtml plug-in, it limits the characters as expected, but is not closing all the html tags.  Am I doing something wrong?

    {exp:trunchtml chars="150" ending="<a href='{url_title_path={my_weblog}/comments}'>...Read Full Workout</a>"}{body}{/exp:trunchtml}


    The “body” field usually has an html bulleted list in it and that’s where the problems lies - the truchtml tag isn’t closing the <li> or <ul> tags.

  • #2 / Jun 25, 2008 10:42pm

    susansan

    75 posts

    anyone?

  • #3 / Jun 26, 2008 3:53am

    Ingmar

    29245 posts

    I don’t really know much about TruncHTML, but you might have to modify the plugin to include these tags.

  • #4 / Jun 26, 2008 12:08pm

    silenz

    1651 posts

    I tested it with:

    {exp:trunchtml chars="100" ending="<a href='{url_title_path=my_weblog/comments}'>...Read Full Workout</a>"}
    <ul>
    <li>Growing up it all seems so one-sided</li>
    <li>Opinions all provided</li>
    <li>The future pre-decided</li>
    <li>Detached and subdivided</li>
    <li>In the mass production zone</li>
    <li>Nowhere is the dreamer or the misfit so alone</li>
    </ul>
    {/exp:trunchtml}

    Result is:

    <ul>
    <li>Growing up it all seems so one-sided</li>
    <li>Opinions all provided</li>
    <li>The future pre-decided</li>
    <li>Detached and</li></ul><a href="http://{url_title_path=my_weblog/comments}">...Read Full Workout</a>

    Seems to be working fine with lists…

    Are you running the latest version?

  • #5 / Jun 26, 2008 2:39pm

    susansan

    75 posts

    Thank you!  That was exactly the problem - I had downloaded it straight from the EE plugin page assuming it would have been the latest version, but it was not (it was 1.1.2).

  • #6 / Sep 13, 2009 7:30pm

    Adam McIsaac

    8 posts

    I’m using 1.3.2 and having the same problem, though very rarely and inconsistently. The following code block:

    {exp:trunchtml chars="40" inline="..."}
    
      <h6>{headline}</h6>
    <p>                        <br />
    {/exp:trunchtml}    <br />
                            <br />
    {exp:trunchtml chars="300" inline="... <a class='inline_link' href='#'>"}<br />
                            <br />
      {body}<br />
                                <br />
    {/exp:trunchtml}

    ...is placed inside an entries loop with the limit set to 2. The first iteration of the loop is flawless. But in the second one, the <h6> isn’t getting closed and the inline ellipse is being placed even on {headline}s which are under 40 characters. Odd. The path in the second iteration is correct in my code, by the way; I removed the argument because this comment mechanism wasn’t rendering it correctly.

  • #7 / Sep 14, 2009 6:49pm

    silenz

    1651 posts

    Is it possible to PM me the actual contents of the {headline}s and {body}s, so I can recreate this?

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

ExpressionEngine News!

#eecms, #events, #releases