I've been experimenting with the smarty truncate variable modifier and had some trouble getting it to work properly, but once you understand what it does and how to use it, it works reliably and is a fantastic little addition to any smarty based theme.
I'll begin by explaining why I wanted it. I tend to use fairly short titles for my blog entries and assumed (wrongly) that all my theme users might do the same. Checking my backlinks to see how other users were using my themes shocked me. It wasn't long before I started modifying and fixing up my themes to make sure future users wouldn't end up with an ugly mess if they used their blog differently from me.
So, back to the smarty truncate variable, which is used in this site where the blog/post title appears at the top. Anytime I create a post with more than 50 characters the title is truncated to 46 and 4 additional characters ' ...' are added, making a total of 50.


