For the site I am working on, I wanted Wikitools to automatically put capitalization on the words of the page title it generates from the URL. I have all lowercase URLs, but I want the page titles to include capital letters. The accompanying patch introduces a setting that lets the site administrator choose whether to leave the page as is (as it would be with the current code), turn the first letter of the title into a capital, or turn the first letters of all words in the title into capitals.

This is the first patch I submit to any Drupal module, so bare with me. Especially, I am unsure whether the format is exactly right, I created it from my Git repository.

Comments

sadist’s picture

I just discovered this module, still playing around with it. Your patch sounds great, I will definitely want to use it.

Just my two cents, will it be difficult for you to have another function that will make some words to be small letter? E.g. and, is, was, etc.

So page title will be like "Some and Whatever Here"

eelkeblok’s picture

The patch is now using two standard PHP functions (ucfirst and ucwords). Filtering on certain words will make the patch a lot more complicated. Not just technically, but choices would also have to be made like, will this be a fixed set of words? If so, how to handle different languages? If not, should a static filter list be used? In that case, again, how do you handle multi-language sites? I wonder if this is worth the trouble, to be honest.

sadist’s picture

ouh! I never thought about other languages, so you're right and I do agree with you.

jpmckinney’s picture

Status: Active » Reviewed & tested by the community

Looks good to me. Up to maintainer if it is a desirable feature.

jpmckinney’s picture

Status: Reviewed & tested by the community » Needs review