Plugin index

This is a simple plugin to cut a string of plain text (not (X)HTML!) at a specified character limit (UTF-8 aware) and then add a trailing string (i.e. ellipsis).

You can use it to take an article title (or any other non-html escaped text) and trim it down to a specified character limit then add an ellipses. Possibly used for article navigation (prev/next) or an article list where you want to keep the titles short.

Example:

<txp:sab_substr limit="10" trail="..."><txp:title /></txp:sab_substr>

will output “long string…”, assuming the title is ‘long string title’.

Attributes:

PS. This plugin was originally released by Steve from bluecamel.org, but when it was no longer available, I wrote it anew from scratch to be a drop-in replacement.