Why not use CSS?
I’m trying to accomplish much more than what CSS is capable of. For starters, the text-transform property is extremely inflexible, capitalizing every single word – which contradicts nearly every style guide known to man. I’m also wanting to convert special characters into HTML entities on the fly (using Smarty Pants); as well as prohibit widows.
Have you tried the Typogrify plugin? It’s essentially a port of the Django plugin of the same name and incorporates widon’t and smartypants.
You can use it with the Title Case plugin provided you edit pi.title_case.php first to check for and include pi.typogrify.php instead of pi.smarty_pants.php. That way you can use the following:
{exp:typogrify}{exp:title_case}{title}{/exp:title_case}{/exp:typogrify}
Which is a small improvement, right?
@Sean
I have been struggling with the same thing. That is why I created the Title Case plugin to begin with (based on John Gruber’s script), but I wasn’t happy with that. I then required that SmartyPants be installed (the latest version makes it optional) to fix issues with straight quotes (and to use that SmartyPants typography goodness that I love so much) without having to wrap my titles in another plugin. I figured if you were going to go to the trouble of using Title Case, you wanted your titles to be properly formatted, so you’d want SmartyPants applied as well.
Following that reasoning, perhaps it would be good to apply widon’t as well if it is installed.
And if I do that, should the plugin be renamed to “Proper Title”?
@Leevi
Text-transform capitalizes every word (I’m assuming that how people would be setting text-transform, which, obviously does different things depending on how you set it), which is not proper formating for titles. Small words should be lowercase, etc.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.