[TYPO3-obts] TypoScript doubt

Antonio Álvarez Feijoo aalvarez at igalia.com
Fri Jun 6 09:12:32 CEST 2008


> Hi Antonio,
>
> waow, you made it. this list has been rather dead for a couple of weeks
> I think. ;)

I didn't know it, it's the first time that I write to a TYPO3 list... ;)

>>
>> My problem is that I want to load CSS dynamically using TypoScript, but
>> when I use a postUserFunc this doesn't work. Example:
>>
>> temp = TEXT
>> temp.value = fileadmin/templates/css/mycss_es.css
>
> If you want to include stuff from a file use the FILE object
> If you want to only insert a link to a file, you could proceed as you
> have done.
>
> Using a userFunc for including CSS though is like taking an Airplane to
> go to next door neighbor. I'd suggest to invest some more time into
> understanding and using TypoScript.
>

I don't want a userFunc for including CSS. I only want the path in a TEXT
cObject. I use the userFunc to modify the base path, adding one suffix for
one CSS or other depending of the language.

temp2 = TEXT
temp2.value = fileadmin/templates/css/mycss
# PHP function that add "_es.css" to .value
temp2.postUserFunc = user_module->suffix

I think that this is more comfortable when you have to add new languages
to the website with a specific CSS, than go through the contents tree
searching and adding:

[globalVar = GP:L=1]
page.includeCSS.file1 = fileadmin/templates/css/mycss.css
[globalVar = GP:L=2]
page.includeCSS.file1 = fileadmin/templates/css/mycss_es.css
[...]

What's your opinion about?

-- 
Antonio Álvarez Feijoo
Computer Science Engineer
mailto:aalvarez at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com





More information about the TYPO3-project-obts mailing list