count_paragraphs - pfaciana/latte-js GitHub Wiki
Used to count the number of paragraphs in a variable.
Template:
{$articleTitle = 'War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.\n\nMan is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.'}
{$articleTitle|count_paragraphs}
output:
War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.
Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.
2
see also count_paragraphs in PHP Smarty documentation.