Einzelnen Beitrag anzeigen
  #3  
Alt 31.07.08, 15:47
duff duff ist offline
Forum Newbie
 
Registriert seit: 06.02.08
Alter: 28
Beiträge: 15

Das stimmt, hatte damit herumexperimentiert um zu prüfen, ob die Daten aus der locallang.xml überhaupt verwendet werden und es evtl. funktioniert, wenn man en als default verwendet etc.

Zum Umschalten verwende ich das PHP languageMenu von Kasper in einer etwas modifizierten Form.. so sieht's aus:

PHP-Code:
if (!is_object($this)) die ('Error: No parent object present.');
 
 
// First, select all pages_language_overlay records on the current page. Each represents a possibility for a language.
$res $GLOBALS['TYPO3_DB']->exec_SELECTquery('*''pages_language_overlay''pid='.intval($GLOBALS['TSFE']->id).$GLOBALS['TSFE']->sys_page->enableFields('pages_language_overlay'), 'sys_language_uid');

$langArr = array();
while(
$row $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))    {
    
$langArr[$row['sys_language_uid']] = $row['title'];
}

// Set each icon. If the language is the current, red arrow is printed to the left. If the language is NOT found (represented by a pages_language_overlay record on this page), the icon is dimmed.
$flags = array();
$flags[] = '<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']->id.'&L=0').'" lang="de" xml:lang="de" target="_top"><img src="fileadmin/media/flags/flag_de'.($GLOBALS['TSFE']->sys_language_uid==0?'_grau':'').'.gif" width="21" height="13" hspace="5" border="0" alt="Diese Seite auf deutsch" /></a>';
$flags[] = '<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']->id.'&L=1').'" lang="en" xml:lang="en" target="_top"><img src="fileadmin/media/flags/flag_uk'.($GLOBALS['TSFE']->sys_language_uid==5?'_grau':'').'.gif" width="21" height="13" hspace="5" border="0" alt="Switch to English" /></a>';

// 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 implode('',$flags); 
Ist zwar nicht besonders schön, aber hat bisher immer prima funktioniert und spart mir Typoscript, was gut ist, weil mehrere Seiten mit eigenem TS-Setup parallel in dem Projekt betrieben werden. Meinst du es liegt daran?

Gruß,
David
Mit Zitat antworten