utilitees

- Addons for ExpressionEngine 1.6.x

Trimmer Documentation

Download Download

Installation:

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

Back to top

Tag:

{exp:trimmer}{/exp:trimmer} 

Back to top

Parameters:

start_after="foo" 

Removes anything before the first occurence of “foo”, including “foo”.

stop_before="bar" 

Removes anything after the first occurence of “bar”, including “bar”.

left="X" 

cuts X characters from the beginning of the text surrounded by the trimmer-tag

right="X" 

cuts X characters from the end of the text surrounded by the trimmer-tag

Back to top

Examples:

I.

{exp:trimmer left="3" right="4"}
<p>Some text to trim.</p>
{/exp:trimmer} 

returns:

Some text to trim

II.

{exp:trimmer start_after="learn" stop_before="c"}
Next week
well learn how to defend ourselves against someone carrying grapes.
{/exp:trimmer} 

returns:

how to defend ourselves against someone 

Back to top

Note:

You can combine any parameters as long as you keep in mind the order in which they are executed.

  1. start_after
  2. stop_before
  3. left
  4. right
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?