Proper Titles
Posted: 24 June 2008 05:55 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  165
Joined  11-30-2004

There’s gotta be a better way than this:

{exp:widont}{exp:smarty_pants}{exp:title_case}{title}{/exp:title_case}{/exp:smarty_pants}{/exp:widont}

Anybody care to whip up a pi.proper_title.php? :)

Profile
 
 
Posted: 24 June 2008 06:51 PM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1306
Joined  01-24-2006
Sean Sperte - 24 June 2008 05:55 PM

There’s gotta be a better way than this:

{exp:widont}{exp:smarty_pants}{exp:title_case}{title}{/exp:title_case}{/exp:smarty_pants}{/exp:widont}

Anybody care to whip up a pi.proper_title.php? smile

Why not use CSS?

text-transform:capitalize
 Signature 

Newism - Newcastle Web Design & Development


NSM Publish Plus - Collaborative workflow and live entry previews
LG Better Meta - SEO Meta & XML Sitemap Generator
LG Polls
LG .htaccess Generator
20+ EE addons

Profile
 
 
Posted: 24 June 2008 07:17 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  165
Joined  11-30-2004
Leevi Graham - 24 June 2008 06:51 PM

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.

Profile
 
 
Posted: 11 July 2008 12:11 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  44
Joined  08-18-2005

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?

Profile
 
 
Posted: 11 July 2008 01:35 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Avatar
Rank
Total Posts:  64
Joined  02-02-2006

@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.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120350 Total Logged-in Users: 87
Total Topics: 126475 Total Anonymous Users: 66
Total Replies: 665097 Total Guests: 432
Total Posts: 791572    
Members ( View Memberlist )
Newest Members:  RanjanjoyMihai NorthThatchVagariPatient ShareNixnizviVadotlogikCariNetX-C0d3C