Zum Inhalt springen

Beim wechseln der Sprache trotz realurl "Kryptische URL"

Erstellt am 8. Januar 2010 · 2 Antworten · letzte Antwort am 8. Januar 2010

Tags: RealURL, Frage

smart ·

Hallo Forum,

Ich habe realurl_1.5.3 und als zweite Sprache "english", mit Flaggen im Einsatz.

Real Url funktioniert auch soweit ich bekomme beide Sprachen mit entsprechender URL angezeigt.

Mein Problem ist:
wenn ich bsw. auf der Seite .../kontakt auf die englische Flagge klicke wechselt die URL auf .../index.php?id=8&L=1 anstatt auf .../contact.
Klicke ich auf der englischen Seite weiter stimmen die URL´s wieder.

Wie oder wo kann ich einstellen das beim wechseln der Sprache direkt die richtige URL angezeigt wird?

Vielen Dank wie immer im Voraus
Martin

smart ·

Ähh natürlich, sorry...

über die my_language.php:

<?php
$query = "SELECT * FROM pages_language_overlay WHERE pid=".$GLOBALS["TSFE"]->id.$GLOBALS["TSFE"]->sys_page->enableFields("pages_language_overlay")." GROUP BY sys_language_uid";
 
$res = mysql(TYPO3_db,$query);
$langArr=array();
while($row=mysql_fetch_assoc($res))     {
        $langArr[$row["sys_language_uid"]]=$row["title"];
}

if ($GLOBALS["TSFE"]->sys_language_uid!=0 && $GLOBALS["TSFE"]->sys_language_uid!=1 ) {

$flags[] = '<img src="typo3/sysext/cms/tslib/media/flags/flag_de-of.jpg" hspace="2" border="0">&nbsp;&nbsp;<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=1" target=_top><img src="typo3/sysext/cms/tslib/media/flags/flag_uk.jpg" hspace="1" border="0"></a>';

} elseif ($GLOBALS["TSFE"]->sys_language_uid==0){
$flags[] = '<img src="typo3/sysext/cms/tslib/media/flags/flag_de-of.jpg" hspace="2" border="0">&nbsp;&nbsp;<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=1" target=_top><img src="typo3/sysext/cms/tslib/media/flags/flag_uk.jpg" hspace="1" border="0"></a>';
} 
elseif ($GLOBALS["TSFE"]->sys_language_uid==1) {
$flags[] = '<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=0" target=_top><img src="typo3/sysext/cms/tslib/media/flags/flag_de.jpg" hspace="2" border="0"></a>&nbsp;&nbsp;<img src="typo3/sysext/cms/tslib/media/flags/flag_uk-of.jpg" hspace="1" border="0">';
}
// Make the little menu. Notice, the menu does ONLY transfer the page-id and the "L" variable (which is also SPECIFIC for this website because "L" has been used in the extension template used to control the language setup)

$content = '<table border=0 cellpadding=0 cellspacing=0><tr>
<td><img src=clear.gif width=30 height=1></td>
<td>'.implode("",$flags).'</td></tr></table>';
?>

die PHP DAtei habe ich im TS des root Templates über einen Marker verknüpft und wie unten konfiguriert:

  marks.LANGUAGE= PHP_SCRIPT
  marks.LANGUAGE.file = fileadmin/my_languageMenu.php  


### Sprachweiche ###
config.linkVars = L
config.sys_language_uid = 0
config.language = de
config.locale_all = de_DE

English language, sys_language.uid = 1
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = en
config.locale_all = en_EN
[global]