text requiredThe text to shorten. HTML tags are stripped before the length is measured (unless the original text already fits within length, in which case it is returned untouched).
length optional default 49Maximum number of characters to keep. The value is cast to an integer.
mode optional default 2Where to cut. 0 cuts at the exact length; 1 tries to stop at the end of a paragraph or sentence; 2 (default) is smart - it uses mode 0 for length under 50 and mode 1 for 50 or more; 3 keeps the start and end and joins them with an ellipsis in the middle.
add optionalText appended only when the input was actually shortened (so the result can be up to length plus add long). Parameters are not trimmed, so a leading space such as in the value space-dot-dot-dot is preserved.
{shorten:The quick brown fox jumps over the lazy dog.:25:0: ...}
{shorten:Hello world this is a long text:10}
{shorten:First sentence here. And much more text beyond the limit.:30:1}
{shorten:The quick brown fox jumps over the lazy dog.:20:3}
{shorten:Short note:49}
{shorten:<b>Bold title</b> with more words:10}