[TYPO3] Force Language and L-parameter

Ralf Hettinger ng at ralfhettinger.de
Thu Dec 28 11:53:50 CET 2006


Hi Søren,

to solve this on a global scope (meaning page-wide), the "dirty" approach seems
to be sort of very useful to me.

Only I would suggest to use another script to achieve a "cleaner" solution and
avoid those reloads (just mentioned you do not even redirect, it's just a
"nasty" meta refresh ;) )

Better use the following and no reload should be needed:

<?php
if (t3lib_div::_GET('L')=='') {
  $GLOBALS['TSFE']->linkVars.='&L=1';
  t3lib_div::_GETset('1','L');
}
?>

Hope this helps?

Cheers Ralf


Søren Schaffstein schrieb:
> <?php
> if (!isset($_GET['L'])) {
>     $url =
> t3lib_div::locationHeaderUrl(t3lib_div::linkThisScript(array('L' => 1)));
>     echo '<html>' . "\n";
>     echo '<head>' . "\n";
>     echo '<meta http-equiv="refresh" content="0; URL='.$url.'">' . "\n";
>     echo '</head>' . "\n";
>     echo '<body>' . "\n";
>     echo '</body>' . "\n";
>     echo '</html>' . "\n";
>     exit;
> }
> ?>


More information about the TYPO3-english mailing list