Hi everybody,

When i wrote a new title of a content, i would like that the first letter is an uppercase..
I use my keyboard to write the first letter (with shift) but in a preview all the title is in lowercase..
How can i do to solve this problem..

Tanks..

Comments

jscoble’s picture

Check your theme .tpl files, it may be automatically changing the title to all lower case.

khzied’s picture

How can i check this?

jscoble’s picture

Sorry, I should have said check your *.tpl.php files for your theme.

Go to the directory of the theme you are using and look at the php in the various .tpl.php files. You will probably see some code in there transforming your titles to lower case. If you are not sure, either post the theme name that you are using or add create an issue for this behavior in the theme's issue queue.

leotemp’s picture

Why not just use CSS on those elements and use text-transform to make them capitalize, this has the added benefit of not hard coding it one way or the other.

EXAMPLE:

.menu h2 { text-transform: capitalize; }

your css selector may be different then that, there are also the following options:

capitalize
uppercase
lowercase
none

tanoshimi’s picture

The css above will capitalise the first letter of every word in the title - if you only want to capitalise the first letter of the title, you could use the first-letter css pseudo-element instead:

h2:first-letter {
  text-transform: uppercase;
}
leotemp’s picture

good point!

vako’s picture

How can we apply this capitalization CSS to form fields, like Webform content, subject lines on comments, etc.?