EE Plugin: Multipurpose Limiter
One of my side jobs has warranted the creation of a simple little plugin to limit output by standard english delimiters (paragraph, sentence, word, character).
Download: Multipurpose Limiter
This plugin permits you to limit text by character, word, sentence or paragraph. Usage Wrap anything you want to be processed between the tag pairs:
type is one of the following: paragraphs, sentences, words or characters.
value is a numeric value. (Note: limiting by characters will leave words intact so you might get a few extra characters.) It is possible (and even desired) to specify multiple options. The plugin works through the options in a backwards manner, starting with paragraphs and then on down to characters. The output of each defined limit is applied to the subsequent limit. Example: The request {exp:limiter paragraphs="1" words="50"} will yield the first paragraph of the tagged text. However, after the paragraph is trimmed, the result will be trimmed down to 50 words (unless the paragraph is already shorter than that value). Switching the order of the limits does not effect the behavior; it always processes from the largest element (paragraphs) to the smallest (characters). Hope that helps someone.
This plugin permits you to limit text by character, word, sentence or paragraph. Usage Wrap anything you want to be processed between the tag pairs:
{exp:limiter type="value" }
text you want processed
{/exp:limiter}
value is a numeric value. (Note: limiting by characters will leave words intact so you might get a few extra characters.) It is possible (and even desired) to specify multiple options. The plugin works through the options in a backwards manner, starting with paragraphs and then on down to characters. The output of each defined limit is applied to the subsequent limit. Example: The request {exp:limiter paragraphs="1" words="50"} will yield the first paragraph of the tagged text. However, after the paragraph is trimmed, the result will be trimmed down to 50 words (unless the paragraph is already shorter than that value). Switching the order of the limits does not effect the behavior; it always processes from the largest element (paragraphs) to the smallest (characters). Hope that helps someone.
Post Your Comment




Trackbacks are disabled for this entry