Documentation: Trimmer

Installation:

Unzip the archive and copy the folder trimmer into the /expressionengine/third_party/-directory inside your system-directory.

Tag:

{exp:trimmer}{/exp:trimmer} 

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

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
we'll learn how to defend ourselves against someone carrying grapes.
{/exp:trimmer} 

returns:

how to defend ourselves against someone 

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