I'm trying to find a way to wrap a long headline after a specific number of words, based on the total character count of the headline. My purpose is to make the bottom line of the wrapped text longer than the top line to increase readability.
I'd like to use Smarty to find the character count of the headline, then decide how long to make the first line based on the default font size and the width of the containing element. But I'm not a coder and don't know the best way to make arrays, foreach loops, iteration counts, and other stuff that's probably necessary to pull this off.
I'm basically trying to:
1) Find the total character count of the headline using {$item.name|count_characters:true}
2) If the total character count is between 60 and 100 characters, add a br tag at the end of the first word that ends past 30 characters.
Anyone who's up for the challenge would help me out a lot. Thanks!