[TYPO3] JSMENU for choose language doesn't work

Jochen Stange derstange at gmx.de
Tue Aug 22 23:13:46 CEST 2006


Hi Christophe.


> I would like to use JSMENU to choose my language, but i can't find a 
> solution.

I've had trouble using something like the JSMENU but we needed one. So here 
is the solution (not very nice and quite static, but working)

# DROPDOWN LANGUAGE MENU #

lib.langmenu = HMENU
lib.langmenu.wrap=<form action="#"><select name="select_menu" onChange="if 
(this.value != '') { document.location.href = this.value; } return 
false;">|</select></form>
lib.langmenu {

1 = TMENU
1 {
  NO = 1
  NO.allWrap.dataWrap = <option value="">Language</option> || <option 
value="{field:uid}.html?L=0">DE</option> || <option 
value="{field:uid}.html?L=1">EN</option> || <option 
value="{field:uid}.html?L=2">FR</option> || <option 
value="{field:uid}.html?L=3">ES</option> || <option 
value="{field:uid}.html?L=4">IT</option>
  NO.doNotShowLink = 1
  }
}

You may have to adjust the type of link (since we're simulating static here 
(.html) instead of index.php?id=xxx.
It's static since you have to adjust the menu every time you add a language. 
Please note the first entry 'Language' has to be set because the select 
reacts to 'onChange' which would result in not beeing able to switch back to 
DE if this were the first entry and the user had switched to another 
language.

Hope this helps.
Cheers from Germany.
Jochen Stange
die medienagenten
http://www.medienagenten.de 





More information about the TYPO3-english mailing list