Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-01-07 22:31:45

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

German umlaut in clean URL > idea

Hello everybody!

I’m working on my first textpattern-website and I noticed a problem with German umlauts in the clean URL mode:

If the title contains an umlaut, it’s deleted in the clean URL.
I think it would be much “cleaner” to replace “ö” (ö) with “oe”, “ä” (ä) with “ae” etc.

I had an idea to fix this problem as I looked at the textpattern source code:

I changed the function

<pre>
<code> function stripSpace($text) { global $txpac; if ($txpac[‘attach_titles_to_permalinks’]) {

$text = preg_replace(“/(^| &\S+;)|(<[^>]*>)/U”,”“,$text);

</code>
</pre>

in “publish/taghandlers.php” to

<pre>
<code> function stripSpace($text) { global $txpac; if ($txpac[‘attach_titles_to_permalinks’]) {

$text = str_replace(“&#196;”,“Ae”,$text); $text = str_replace(“&#228;”,“ae”,$text); $text = str_replace(“&#214;”,“Oe”,$text); $text = str_replace(“&#246;”,“oe”,$text); $text = str_replace(“&#220;”,“Ue”,$text); … etc …

$text = preg_replace(“/(^| &\S+;)|(<[^>]*>)/U”,”“,$text);
</code>
</pre>

I’m not sure if this is the best solution, but it works.

Vielleicht hilft das ja dem einen oder anderen oder jemand hat selbst noch eine andere Idee…

Offline

#2 2005-01-09 11:29:10

ChrisJ
Member
From: Vienna, Austria
Registered: 2004-03-30
Posts: 54
Website

Re: German umlaut in clean URL > idea

I think this is a really nice idea, Skubidu. Works great on a German client’s site.

Offline

Board footer

Powered by FluxBB