[TYPO3-dev] Defining TS setup config. via ext script
Simon Tuck
e-mailNO at SPAMeyejet.com
Sun Jun 25 19:44:53 CEST 2006
Hi Christopher,
>
> If you're just talking about writing an extension that loads the TS
> and TSconfig values that you usually use, yes it's possible.
Nope, that's not what I meant. Specifically what I'd like to do is load the defined languages from the sys_languages table and set corresponding
language information in TS setup, e.g. config.language, config.sys_language_uid, config.locale_all, config.htmlTag_langKey etc. Usually we end
up defining this information through conditions [globalVar = GP:L = 1] etc., with a large number of languages that is unwieldy. and anyway all
the relevant information is in sys_languages and static_languages, so I'd hoped to be able to define these config vars via an extension.
Unfortunately I cannot set the language vars dynamically through typoescript as the content select function automatically excludes any tables
with the prefixes 'static_' or 'sys_' (which I find strange). Anyway, if I 'fix' that, in theory I can get the current language information from
GP:L, for example with the following TS:
lib.currLang = CONTENT
//lib.currLang.stdWrap.debugFunc = 2
lib.currLang {
table = static_languages
select {
andWhere = 1=1 OR (sys_language.static_lang_isocode = static_languages.uid AND sys_language.uid = {GPvar:L})
andWhere.insertData = 1
max = 1
pidInList = 0
join = sys_language
}
renderObj = TEXT
renderObj.field = lg_iso_2
renderObj.case = lower
}
If L=1 and the language iso code of sys_language=1 is 'de' that will give me de. Of course I'd need to expand the TS to account for L=0 (i.e.
default language), but ultimately the approach is doomed because none of the config properties have stdWrap and I can't insert the result from
lib.currLang.
So I tried to set these values from the ext USER_INT script, e.g. $GLOBALS['TSFE']->config['config']['htmlTag_langKey'] = 'de'
but that has no effect, or at least it has no effect on the page header.
So my question is if (a.) it's possible and I'm just missing something, or (b.) should I propose a hook in GLOBALS['TSFE']->getConfigArray(), or
(c.) should I shut down my pc and watch the football.
Tough choices ;)
Cheers,
Simon
More information about the TYPO3-dev
mailing list