We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24634
    • 58 Posts
    Displaying the content using ellipsis to limit the number of characters displayed causes a problem with html in the content. The html tag characters are part of the total count. This will leave tags open without the closing tab</..> or >, open "s and other related issues. It appears the truncation is by raw char count and not verifying if html remains valid.

    Is there a workaround to handle the issue? Or is the problem deeper in the php when parsing, tokenizing and determining which characters to count?

    Roy

    This question has been answered by sottwell. See the first response.

    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      [[+content:striptags:ellipsis]]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 24634
        • 58 Posts
        sottwell,

        Thanks so much for the help. It did the job!

        I need just a little bit more to get the content just the way I wanted it.

        [[+content:striptags=`<p><a><strong>`:ellipsis=`500`]]


        Thanks again,

        Roy