Trimmer Documentation
Installation:
Unzip the archive and copy the file pi.trimmer.php into the plugins-directory inside your Expression Engine 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, well 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.
- start_after
- stop_before
- left
- right