[TYPO3] Force Language and L-parameter

Søren Schaffstein soeren.schaffstein at media-lights.de
Wed Nov 29 15:47:28 CET 2006


JoH,

you are right. I pointed this possibility in this thread out as well, 
but came to the conclusion that it lacks usability. Since it could 
happen that a new menu is created in the future. Then nobody remembers 
the "page-where-language-was-forced" and all links in this new menu 
won't work correctly.

If I was only able to set additionalParam globally so that it affects 
everything generated with typolink...

Søren


JoH asenau wrote:
>> A possible - but dirty - solution:
>>
>> For now we have a solution which is not really nice, but at least it
>> works. Idea is to include a library with TypoScript on the page where
>> we want to force the language. This can easily be done like this:
>>
>> #include library to insure that the L parameter is set
>> includeLibs.tx_lparam = fileadmin/templates/libraries/set_l_param.inc
>>
>> The library does two simple things.
>> 1. checks if L is set
>> 2. if L is not set, the page is reloaded with L set to our preferred
>> value (L=1)
> 
> If you are able to set the language using a condition (or maybe a TS
> ext-template), you could change the default behaviour for typolink (which is
> used for almost any link in TYPO3) too.
> 
> Simply add
> 
> additionalParams = &L=123
> 
> to any occurence of typolink.
> OK - I have to admit that it's not that simple, since there might be many
> different places and for menus it's a bit tricky, but it should work without
> a reload then.
> 
> Joey
> 


More information about the TYPO3-english mailing list