We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Proplem with Word Limit Plugin

Development and Programming

MSimos's avatar
MSimos
62 posts
18 years ago
MSimos's avatar MSimos

Hello once again with one more question….

here’s the problem with the World Limit Plugin

I want to limit my {body} words to 65 and I do this with the code:

<div class="entry">
{exp:word_limit total="65"}
{body}
{/exp:word_limit}
</div>

The problem is when i do that, if the last word in the post ends with an italic or bold word, the rest of the text from that post in the blog becomes either italic or bold.

I can not figure it out…. help.

Thanx.

[Moderator Edit: Moved to Plugin Questions forum]

       
ms's avatar
ms
274 posts
18 years ago
ms's avatar ms

This problem is inheritant with this kind of plugins. You can only strip all HTML coding before truncation. There is another plugin available from mdesign, that does this: eexcerpt. However, all formating and styling will be lost using this approach.

-Markus

       
silenz's avatar
silenz
1,648 posts
18 years ago
silenz's avatar silenz

Or TruncHTML. It limits by number of characters, though. But it doesn’t count chars in HTML-tags, doesn’t truncate in the middle of tags and tries to close all tags that are left open.

       
MSimos's avatar
MSimos
62 posts
18 years ago
MSimos's avatar MSimos

I will try both solutions thank you.

Although I don’t get the cause of this problem. Why would it effect the rest of the text all around the blog since the tag is closed?

       
silenz's avatar
silenz
1,648 posts
18 years ago
silenz's avatar silenz

That usually happens when the Word Limit Plugin cuts off the text in between an opening and a closing tag.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.