feature:replace ö in page name with oe

Permalink
Hi!

1. What does it do?
2. How did I do it?

1.
If you add a new page and use umlauts like:
èéÈÉäÄüÜöÖØøÆæÅå or ß it will automatically replace the page alias with e,ae,ue,oe or sz and that's all. But it comes in handy often for European C5 users.

2.
I copied
concrete/elements/collection_add.php
to
elements/collection_add.php

Concrete will now use our collection_add.php not the one of the core and simply replace the Javascript function in that file with the following ->http://pastie.org/558913 that's it.

NEW [corrected]: Danish Characters !

http://pastie.org/562824

Hope, the C5 devs include it in the future release along with many other features like an interface to select a theme for a single page, no more hacking in php.

PS: I know it don't need to look for the capital characters, but why not? Maybe it's usefull somewhere else.. Capital first, lowercase letter second. I don't target the "new" capital ß, because there is no word I know and if there was 1000 words. I don't have a key for it :(

Best regards
Fernandos

Fernandos
 
Fernandos replied on at Permalink Reply
Fernandos
you can extend it as you wish.
If you find your extension of characters usefull please feel free to contribute.

I had not enough time to include more characters or make the code cooler.
griebel replied on at Permalink Reply
griebel
Hi Fernandos, great tip,

For the danish page alias we need æøå, an addition to the script:
alias = alias.replace(/[\u00C6\u00C6]/gi, "ae"); // æ
alias = alias.replace(/[\u00D8\u00D8]/gi, "oe"); // ø
alias = alias.replace(/[\u00C5\u00C5]/gi, "aa"); // å
Fernandos replied on at Permalink Reply
Fernandos
Hi, Griebel!

You've had little errors, I fixed it.
Checkout the updated code above.
Andrew, please consider the corrected code in the 1st post.
andrew replied on at Permalink Reply
andrew
We will try to integrate this into c5 in the next version, because it's a nice addition. There are also a few places in the backend where this will need to be integrated too (not just the javascript). Nice job.
Fernandos replied on at Permalink Reply
Fernandos
Hi, Andrew and Griebel!

Nice, to get your contribution Griebel.
I've added your code to my original paste.

Yes Andrew, I've seen that the regex had more occurences in the code, but nice to hear that the code is getting into the core :)

(didn't want to hack too deep. Because I avoid hacking the core. That's why I put always a copy into the folders one dir up^ /concrete. I want to keep track of my changed and be able to update)

I'll try to add a JS/PHP Diff replacement for the python one in near future too..

Best regards
Fernandos
Styves replied on at Permalink Reply
Styves
à and À to a
â and  to a
ê and Ê to e
î and Î to i
ô and Ô to o
û and Û to u

ï and Ï to i

ù and Ù to u

ç and Ç to c

Thanks Andrew for adding these also.
Thanks Fernandos for your contribution.

Cheers!
Fernandos replied on at Permalink Reply
Fernandos
the same with umlaut's but for php and betterhttp://pastie.org/576237
SigmaAlphaPi replied on at Permalink Reply
SigmaAlphaPi
Hi!

Sorry, but "ß" should be converted to "ss" instead of "sz".
You're right, the letter is called "SZ" (or sharp S) in german, but might/shall be written as double-s.

Cheers,
Sven