---
title: "Sprachmenü blockiert die Ajax-Suche"
url: "https://www.typo3.net/d/66546-sprachmenue-blockiert-die-ajax-suche"
source: "typo3.net"
tags: ["TYPO3","Mehrsprachigkeit","Frage","JavaScript & AJAX","Suche"]
created: "2007-08-09"
last_reply: "2007-08-09"
replies: 6
solved: false
page: 1
pages: 1
lang: "de"
---

# Sprachmenü blockiert die Ajax-Suche

TYPO3 › Mehrsprachigkeit · 6 Antworten · gestartet 2007-08-09

## Eröffnungsbeitrag

**poli-dori** · 2007-08-09 · [Beitrag #1](https://www.typo3.net/d/66546-sprachmenue-blockiert-die-ajax-suche/1)

Hi Experten,

wieder ein neues Problem.
Ich bastle gerade an einer 3-sprachigen Website. Ich hatte die Ajax-Suche installiert und sie hatte auch einwandfrei funktioniert bis ich das Sprachmenü eingefügt habe. Das Sprachmenü ist eine externe PHP-Datei die folgendermaßen eingefügt wird:

```typoscript
LANG_BOX = COA
LANG_BOX.1 = PHP_SCRIPT
LANG_BOX.1.file = fileadmin/templates/scripts/languageMenu.php
```

Die Sprachauswahl funktioniert. Die Ajax-Suche nicht mehr... :'(

Hab schon probiert die Suche im TS nach dem Sprachmenü zuzuweisen, hat aber auch nix genützt.

Kann mir jemand bitte weiterhelfen.
Das PHP-Script schaut so aus:

```php
<?php
/***************************************************************
*  Copyright notice
*
*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*  A copy is found in the textfile GPL.txt and important notices to the license
*  from the author is found in LICENSE.txt distributed with these scripts.
*
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/*
 * Creates a language-selector menu with three flags, an english, a danish and a german flag for each language supported on the site.
 *
 * THIS IS AN EXAMPLE designed to work with the official TYPO3 testsite, section "Another site in the ..."
 * You will have to program a similar menu for your own case.
 *
 * $Id: example_languageMenu.php,v 1.6 2005/04/01 14:37:14 typo3 Exp $
 * Revised for TYPO3 3.6 June/2003 by Kasper Skaarhoj
 * XHTML compliant
 *
 * @author	Kasper Skaarhoj <kasperyyyy@typo3.com>
 */


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'];
}

// Little red arrow, which is inserted to the left of the flag-icon if the TSFE->sys_language_uid equals the language uid (notice that 0=english, 1=danish and 2=german is SPECIFIC to this database, because these numbers refer to uid's of the table sys_language)
#$pointer = '<img src="t3lib/gfx/content_client.gif" width="7" height="10" align="middle" alt="" />';

// 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').'" target="_top"><img src="fileadmin/templates/images/flagDeu.gif" width="15" height="11" hspace="1" border="0" alt="Diese Seite auf Deutsch" style="position: relative; top: 1px;" title="Diese Seite auf Deutsch" /></a> ';

$flags[] = '<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']-">id.'&L=1').'" target="_top"><img src="fileadmin/templates/images/flagIta.gif" width="15" height="11" hspace="1" border="0" alt="Visualizza questa pagina in italiano" style="position: relative; top: 1px;" title="Visualizza questa pagina in italiano" /></a> ';

$flags[] = '<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']-">id.'&L=2').'" target="_top"><img src="fileadmin/templates/images/flagEng.gif" width="15" height="11" hspace="1" border="0" alt="View this page in English" style="position: relative; top: 1px;" title="View this page in 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 = '<div class="langMenu" align="left">'.implode('',$flags).'</div>';

?>
```

Bin um jeden Tip dankbar!

## Antworten

### [#2](https://www.typo3.net/d/66546-sprachmenue-blockiert-die-ajax-suche/2) · just2b · 2007-08-09

fehlermeldungen?

### [#3](https://www.typo3.net/d/66546-sprachmenue-blockiert-die-ajax-suche/3) · poli-dori · 2007-08-09

Leider keine,

die Suche spuckt einfach keine Ergebnisse aus.
Mir kommt diese PHP-Methode für die Sprachauswahl etwas veraltet vor. Gibt es eine GUTE Alternative?

### [#4](https://www.typo3.net/d/66546-sprachmenue-blockiert-die-ajax-suche/4) · just2b · 2007-08-09

zB ext bb_languageselect

georg

### [#5](https://www.typo3.net/d/66546-sprachmenue-blockiert-die-ajax-suche/5) · poli-dori · 2007-08-09

Danke,

ich werds mal testen!

### [#6](https://www.typo3.net/d/66546-sprachmenue-blockiert-die-ajax-suche/6) · poli-dori · 2007-08-09

Ich habs installiert und bekomme diese tolle Meldung:
Warning: Invalid argument supplied for foreach() in .../typo3conf/ext/bb_languageselect/pi1/class.tx_bblanguageselect_pi1.php on line 107
In jener Datei steht auf Zeile 107 folgendes: foreach($countries as $cn => $sys_uid)

#angry#  #angry#  #angry#

### [#7](https://www.typo3.net/d/66546-sprachmenue-blockiert-die-ajax-suche/7) · poli-dori · 2007-08-09

Jetzt funktionierts!

Wow die Extension ist cool, und die Suche funzt auch... noch nicht ganz perfekt was die mehrsprachigkeit betrifft, aber dem werde ich mich morgen widmen... :)

Danke und ciao

---

Quelle: „Sprachmenü blockiert die Ajax-Suche“, typo3.net, https://www.typo3.net/d/66546-sprachmenue-blockiert-die-ajax-suche
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
