utilitees

- Addons for ExpressionEngine 1.7.x

TruncHTML

Version Released Type License
1.3.2 2009-09-02 Plugins Freeware (?)
⇒ TruncHTML for EE 2

TruncHTML Documentation
Docs

Download  TruncHTML
Download

Permalink TruncHTML
Permalink

TruncHTML Version RSS
Version RSS

This plugin is used for limiting text to a specified length. Much like the Character Limiter-Plugin that comes with ExpressionEngine.

The difference is, that TruncHTML is HTML-aware, so you can use it to shorten HTML-formatted text and keep the markup without being afraid of breaking it.

Unlike the standard limiter-plugins it does not count characters that belong to HTML-tags and does not cut-off in the middle of tags.


Example: Limit to 16 characters.
Take a look <a href="ref.html"><img src="arrow.gif" /></aat this page
TruncHTML:
Take a look <a href="ref.html"><img src="arrow.gif" /></aat 
Standard char_limit:
Take a look <a href="ref.html"><img&#8230; 


Furthermore it tries its best to close all tags that remain open after the text has been limited.

So if you limit the following text to 80 chars...
<class="quote"><b>Never let your sense of morals get in the way of doing whats right.<br />
<
em>Isaac Asimov</em></b></p

the result will be ...
<class="quote"><b>Never let your sense of morals get in the way of doing whats right.<br />
<
em>Isaac</em></b></p

instead of ...
<class="quote"><b>Never let your sense of morals get in the way of doing whats 

... which would probably screw the rest of the page.


[...]there wouldn’t be anything wrong with a separate plugin that is content aware. Silenz’s TruncHTML does a fabulous job with that, in fact I use it myself, and I don’t particularly see a reason for a first party solution to be made.[...]
Derek Jones, EllisLab

What does Freeware mean?
Freeware means you may use this addon free of
charge in as many installations as you like.


Comments

cloud computing:
2012-05-21 13:14

I understand how to do it. I will follow your tips.


web design:
2012-05-17 12:36

This is a good design. I really like this style.


yachtcharter italien:
2012-04-27 12:49

I will try to do it like you said.


websites directory:
2012-04-11 14:36

I will use it for sure on my future projects. I am sure that I will have excellent results.


timeline facebook:
2012-03-29 21:52

I understand how to do it. I will follow your tips


web designer:
2012-03-20 16:57

I will use it for sure on my future projects. Seems to work!


vaughan real estate:
2012-03-06 09:48

can we trunch it just for 16 characters? or more?


Snel:
2011-11-28 15:54

I done a research on the issue and learnt most peoples will agree with your blog. Certainly, these practices are unfair; but they say that most of their rules are only to apply to people who overdraw. frases para conquistar uma amiga


Firmahjelp:
2011-11-28 11:04

I agree with some of it not all of it. interesting post found some new things out i did not ralize before on this website.


Features:
2011-11-26 23:00

Is there anyway that I can modify the plugin code to strip out certain html tags I set like an img tag?