[TYPO3-UG Australia] RealURL with multilanguage sites
Michael
typo3ml at schams.net
Fri Mar 9 13:25:06 CET 2007
Hi guys,
I use RealURL with a multilanguage page. Default language is German (L=0), second is English (L=1) an last but not least we've got our french friends (L=2). The URLs contain "de", "en" or "fr" e.g.: "http://system.domain.com/en/products/". My question concerns the TypoScript:
I need a language-dependent link on every page to switch the current page into another language. Before using RealURL my solution was:
--- cut here ---
10 = TEXT
10.field = uid
10.wrap = <a href="?id=|&L=1"><img src="fileadmin/images/icons/flag_en.gif" title="English" alt="English"></a>
--- cut here ---
With RealURL I wrote the "en" and the pageID in the tag:
--- cut here ---
10.wrap = <a href="en/?id=|"><img src="fileadmin/images/icons/flag_en.gif" title="English" alt="English"></a>
--- cut here ---
Unfortunately, RealURL does not recognize the argument "?id=" and displays the homepage of the site (not the current page)... but the right language.
It seems that the long URL generated by RealURL is required instead of the uid:
--- cut here ---
10.field = REALURL_PATH_TO_CURRENT_PAGE
10.wrap = <a href="en/|"><img src="fileadmin/images/icons/flag_en.gif" title="English" alt="English"></a>
--- cut here ---
I assume that it's not possible to get the "REALURL_PATH_TO_CURRENT_PAGE" in TypoScript and I am sure, that there must be a more easy way to solve the problem. Any ideas?
My RealURL configuration in "localconf.php" looks like this:
--- cut here ---
[...]
'preVars' => array(
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'no_cache' => 1,
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'L',
'valueMap' => array(
'de' => '0',
'en' => '1',
'fr' => '2',
),
'valueDefault' => 'de',
),
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => 30
),
'fixedPostVars' => array(),
'postVarSets' => array(),
'fileName' => array()
[...]
--- cut here ---
Thanks in advance.
--
Cheers
Michael
More information about the TYPO3-UG-australia
mailing list