[TYPO3] language menu in drop-down box

lee perry leeperry at slack.de
Fri Sep 12 15:07:23 CEST 2008


rupali schrieb:
> can u refine it more? not getting..

try this:

lib.lang_sel = COA
lib.lang_sel {
	10 = TEXT
	10 {
		typolink.parameter.data = page:uid
		typolink.addQueryString = 1
		typolink.addQueryString.method = GET
		typolink.addQueryString.exclude = cHash,L
		typolink.additionalParams.cObject = COA
		typolink.additionalParams.cObject {
			10 = TEXT
			10.wrap = |&L=0
		}
		typolink.returnLast = url
		wrap = <option value="|" selected="selected">Deutsch</option>
	}
	
	20 < .10
	20.typolink.additionalParams.cObject.10.wrap = |&L=1
	20.wrap = <option value="|">English</option>

	
	wrap = <form action="#" method="get"><select name="select_menu" 
onchange="document.location.href = this.value; return 
false;">|</select></form>
}

[globalVar = GP:L=1]
lib.lang_sel.20.wrap = <option value="|" 
selected="selected">English</option>
[global]

you will get a select-box with the current language selected and by 
changing the value your location will be the transletd page in the other 
language (if there is one). and all with fine human readable URL's 
because there are typolinks and no "index.php?id=|" :)

but you will have a problem, if the user has javascript deactivated!

have fun,
Lee


More information about the TYPO3-english mailing list