Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-04-16 16:06:00

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

how to set section title with first small letter by default

Hi all,

when I add some new section I have to change first letter from capital to small letter. Can be the url-section generetad with all small letters by default?

Offline

#2 2007-04-16 18:35:02

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

Re: how to set section title with first small letter by default

If you enter it in all lower case, that will be the section name. But it will also be the section title, so you’ll then have to change that ;)

You’ve got a point though, many people forget to change section and category names to lower case, and using upper case in names can cause problems.

Offline

#3 2007-04-16 19:13:00

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: how to set section title with first small letter by default

Exactly, I need section title with capital first letter, but in section url I want always all lower letters. It’s crazy to change for example 100 section in e-shop…

Can someone help with plugin or hacking TXP core?

Offline

#4 2007-04-16 19:21:50

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

Re: how to set section title with first small letter by default

Want me to move this to plugin requests?

Offline

#5 2007-04-16 20:03:47

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: how to set section title with first small letter by default

oki, I will post it there

Offline

#6 2007-04-16 20:38:57

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: how to set section title with first small letter by default

If you want neither sections nor categories to have capital letters in your URLs and you don’t mind hacking TXP core:
In the file ‘textpattern/lib/txp_misc.php’, try changing line 621 (in the sanitizeForUrl function) from:

return $text;

into:

return strtolower($text);

Last edited by ruud (2007-04-16 21:35:49)

Offline

#7 2007-04-16 21:01:25

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: how to set section title with first small letter by default

That’s it. Thx, it was so simple ;) thaks again.

Offline

Board footer

Powered by FluxBB