Title Case for Movable Type
22nd May 2008
John Gruber shared a code snippet that converts strings to Title Case. It’s actually more clever than it sounds, taking into account the need to keep a collection of small words uncapitalised, and correctly handling punctuation issues.
Here’s a version for Movable Type that can be used to automatically convert entry titles to title case. It is essentially a wrapper for John’s script that adds some functionality to deal with html entities (so it should play nice with Smarty Pants and Widon’t).
Download
Title Case for Movable Type v1.1 (2008-05-23)
Installation
Unzip the file and place TitleCase.pl in the plugins directory of your Movable Type installation.
(mthome)/plugins/TitleCase.plUsage
For titles, add the global filter titlecase="1" to your entry title tags:
<mt:EntryTitle titlecase="1"/>
Comments
1.
Brook Elgie - 23rd May 2008, 10.07 PM
I’ve updated this to v1.1, with a small change to make the plugin behave better with future versions of MT4. There has been no change to the functionality.
However, this change does mean the plugin is no longer compatible with previous versions of Movable Type, so if you’re using MT3, feel free to download Title Case v1.0 which should work for you.
Comment preview: