Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-29 14:16:13

-rr-
Member
Registered: 2005-09-11
Posts: 73

Sentence case section names?

TXP seems to capitalize all words in section names. Can I disable it somehow, or rather, change it to sentence case e.g.:

This Is A Section Title

to:

This is a section title

Offline

#2 2005-11-29 14:23:30

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Sentence case section names?

I think it’s a case of what you have put into the title boxes in the “Sections” tab plus whatever you may have done already in the CSS to style your titles.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2005-11-29 21:33:37

-rr-
Member
Registered: 2005-09-11
Posts: 73

Re: Sentence case section names?

CSS cannot set sentence case. Only capitalize (all words), lowercase or uppercase.

This is bad, because in our langage area titles are written only with first letter capitalized. TXP seems to capitalize all words automatically no matter what you write in the section title. I’ll have to hack the txp code I guess. Can anybody point me to the right place and how to do it?

Last edited by -rr- (2005-11-29 21:34:04)

Offline

#4 2005-11-29 22:55:09

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Sentence case section names?

TXP seems to capitalize all words automatically no matter what you write in the section title…

Uh, no it doesn’t. I even double-checked. It uses exactly what you tell it to… So, something else is at play here.

Offline

#5 2005-11-29 23:14:39

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Sentence case section names?

rr wrote:

CSS cannot set sentence case. Only capitalize (all words), lowercase or uppercase.

text-transform: capitalize; – Capitalizes the first letter of every word

Edit: what I mean (and Stuart I think) is, do you accidentally have this property set in your CSS?

Last edited by doggiez (2005-11-29 23:17:44)

Offline

#6 2005-11-29 23:33:57

-rr-
Member
Registered: 2005-09-11
Posts: 73

Re: Sentence case section names?

Hmmm. Strange??? Capitalization is not on in CSS. What could it be then, because the section titles are not capitalized in the names?

I’m usind mdp_section_menu to create the section list. Maybe that’s the culprit?

Last edited by -rr- (2005-11-29 23:39:53)

Offline

#7 2005-11-29 23:49:58

-rr-
Member
Registered: 2005-09-11
Posts: 73

Re: Sentence case section names?

In the article http://forum.textpattern.com/viewtopic.php?id=448 I discovered that mdp_sectionmenu indeed capitalizes the names.

I don’t know PHP so could somebody point out to me where it happens in the code and how I can change it to non-capitalize?

I discovered this:

In the line <code>$content = tag(ucwords($sectionname),‘span’);</code> I changed <code>ucwords</code> to <code>ucfirst</code> which now capitalizes only the first letter.

I would prefer to remove the case change altogether. How could I do that?

Last edited by -rr- (2005-11-29 23:58:53)

Offline

#8 2005-11-30 04:06:18

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Sentence case section names?

I’m not too good with PHP myself but I think you can just remove “ucwords” completely. I’m not sure if you still need the parenthesis “()” around <code>$sectionname</code> but try it both ways. You can always put it back if it doesn’t work properly. ;)

Last edited by thebombsite (2005-11-30 04:07:10)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#9 2005-11-30 12:18:41

-rr-
Member
Registered: 2005-09-11
Posts: 73

Re: Sentence case section names?

Yep, removing ucwords and leaving the parenthesis intact worked. Thanks.

Offline

#10 2005-11-30 13:13:14

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Sentence case section names?

Nice one. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB