[TYPO3] get value of GPvar in ts?

Lucas Birk tlist at birkit.com
Fri May 19 14:12:21 CEST 2006


Peter Klein wrote:

>Hi Lucas. Try:
>
>asdf.data = GPvar:L
>
>More info can be found here.. (Seach for "getText")
>http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/2/2/
>
>  
>
Peter,
I tried as you suggested but now it just prints :GPvar:L What I am 
trying to do is avoid the [globalVar = GP:L = 0] thing. Its easy enough 
to check if the language id is in the database but I need the id. This 
idea to get L in the template is just a quick fix for my real problem:
I made a small plugin to make a dropdown language menu and I wanted to 
set the sys_language_uid, language and locale_all dynamically from 
within the plugin. Unfortunately this only half-works. The updated 
values only get passed to other plugins (tt-news for example) but not to 
the menus or mailform_plus. I would suspect that the plugins are run 
after the the typoscript setup but it could be something else. There 
might be a "correct way" to this sort of thing that I am not aware of.

Here is what I am trying to set in my plugin: 
$GLOBALS["TSFE"]->config["config"]["sys_language_uid"]= $new_sys_lang_id;

One way or another I need to solve this small problem: I do not want 
be_users to add typoscript because it's too dangerous. I would either 
like to do it from my plugin or through the typoscript setup.
Of course, I could add more langs to the be that necessary but that 
seems a bit silly!

Thank you for your help,
Lucas.



More information about the TYPO3-english mailing list