Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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(“Ä”,“Ae”,$text); $text = str_replace(“ä”,“ae”,$text); $text = str_replace(“Ö”,“Oe”,$text); $text = str_replace(“ö”,“oe”,$text); $text = str_replace(“Ü”,“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
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
Pages: 1