utilitees

- Addons for ExpressionEngine 1.6.x

TruncHTML Documentation

Download Download

 

Installation:

Unzip the archive and copy the file pi.trunchtml.php into the plugins-directory inside your Expression Engine system-directory.

Back to top

 

Usage example:

Wrap any text/html you want to be truncated inside an {exp:trunchtml}-tag-pair.

{exp:trunchtml chars="300" ending="<a href='{path=site/comments}'>read on</a>"}{body}{/exp:trunchtml} 
Back to top

 

Parameters:

chars="100" 

Defaults to 500. Number of characters that are to be returned.

ending="..." 

Optional. String to be added after the output.

inline="..." 

Optional. This string is placed directly after the truncated text and before any closing tags. If you want the first character to be a space, use an underscore
e.g. inline=“_continue”

exact="yes" 

If this is set, text will be truncated after exactly the specified number of chars. Otherwise text will be cut after a space to prevent cutting words in the middle.

threshold="X" 

If this is set the text will only be truncated if it at least X characters long.
Otherwise the full text is returned.

Back to top

Questions / bug reports

For general comments, brickbats & bouquets please use the form over here.
Name:

Email:

URL:


Remember my personal information
Notify me of follow-up comments?


Page 4 of 4 pages « First  <  2 3 4

User Talk

Oliver:
2008-11-11 10:39

@Chris:
Some parts of your comment obviously got stripped out.
Drop me a mail at .(JavaScript must be enabled to view this email address)



Chris:
2008-10-13 09:40

Would be nice if the ending=”” works with XHTML formatting. For example:

{exp:trunchtml chars=“300” ending=”...”}{article_content}{/exp:trunchtml}

if article_content has some content here, the output would be:

some content here…

instead of: some content here…