I have user-generated content so a lot of the titles submitted are capitalized.

I went into my template and just changed the title as so ucwords($title) and it had... no effect...

I thought perhaps this would be simple to implement, and ideas Drupal people?

Comments

theabacus’s picture

The default template (Garland) has two instances of $title being printed. One is in the node.tpl.php and the other is in page.tpl.php.

However, the better way to do it is using template_preprocess_node() function (http://api.drupal.org/api/function/template_preprocess_node/6) to change the variable (it would be $node->title) before it gets to the template.

abhigupta’s picture

do this ... ucwords(strtolower($title)) ...

AndyW’s picture

That's it, that works

Press Release 001 | Do Follow 001

heytrish’s picture

Another solution is to modify the title appearance through CSS.


h1.title {
  text-transform: uppercase;

/* Other options (not all are posted)

  Capitalize The First Character In Each Word
  text-transform: capitalize;  
  
  transform all characters to lowercase
  text-transform: lowercase; 

  TRANSFORM ALL CHARACTERS TO UPPERCASE
  text-transform: uppercase; 

  Remove all transformations, displays default.
  text-transform: none; 
*/
}

This way, you will have more control over the display of the text, oppose to hard coding it into the template file.