Hopefully the future versions of Drupal will be a little smarter about handling apostrophe S's. I look like nob with with the blog title "Ross's blog". Actually It would be nice to just have it simply be "Blog" or have an option of what to name it.

This is what my Buddy James came up with:

function possessivize($title) {
 return strtolower(substr($title, strlen($title)-1, 1)) == 's' ?
$title . "'" : $title . "'s";
}

Comments

bryansd’s picture

Or how about the Blog of Ross? Actually, I agree...it would be nice to be able to edit the whole title in a settings page. Sometimes you don't really want to call it a blog on the Web pages.

-Bryan

My Drupal Site:
CMSReport

webchick’s picture

webchick’s picture

If it really bothers you, use the locale module to change it to something different. See HOWTO: Customize Drupal text and terminology.

rosshj’s picture

I just hack...er .. patch it in the core.

-
Graphic / Web Designer
Donat Group Enterprises
Project Opus

webchick’s picture

There should be a Drupal motto or something: "If you're hacking core, you're doing something wrong!" ;)

There should be literally almost _no_ reason you should ever have to hack core, between theming, the modules system, using locale to do string translation, etc. The Customization and Theming handbook talks extensively about different approaches you can take.

Hacking core only makes it more painful to do stuff like security updates and version upgrades later on... and also harder to find support since you're running forked code.

So remember kids: Just say "no" to hacking! ;)

rosshj’s picture

I agree but I am no PHP coder (just a simple designer) so a little patch like this does the trick until I can either write a better solution or get my friends to help me out.

-
Graphic / Web Designer
Donat Group Enterprises
Project Opus

rosshj’s picture

Maybe I'm not a nob.

-
Graphic / Web Designer
Donat Group Enterprises
Project Opus

James Andres’s picture

According to that site it depends on how the word sounds.

To form the possessive of a singular noun that ends in an "s" sound, be guided by the way the word is pronounced.

I have read other grammar books giving similar, though slightly different, advice.

In the above examples, the possessive is made by adding an apostrophe plus an s to the word that possesses. However, if the word already ends in s, whether plural or not, it is acceptable to add an apostrophe only.

(source: http://www.bcc.ctc.edu/writinglab/Apostrophe.html)

Add only an apostrophe to form the possessive case of plural nouns ending in -s.

(Source: http://iws.ccccd.edu/cobb/errors.html , originally from the Little Brown Handbook).

It would seem that either is correct depending on who you ask. Bah! that's enough grammar for one day.

Oh, Ross forgot to post my PHPDoc ;-).

/**
 * Determines how to possessivize a title.  Basically it checks to see if the last letter is an 's', if
 * so it adds an "'" but if not it adds an "'s"
 *
 * Yes, there are more correct ways to do it ... so code it!
 *
 * @author James Andres
 * @version January-03-2006
 */

Note the subtle disclaimer :-).

James Andres

Lead Developer on Project Opus
www.projectopus.com