[TYPO3-dev] Dynamic fontColor in GIFBUILDER

Dmitry Dulepov typo3 at accio.lv
Tue Sep 12 16:31:35 CEST 2006


Hi!

Michael Feinbier wrote:
> I've got a very strange (and maybe simple) problem which I cannot solve 
> myself. I want to change the fontColor of a GIFBUILDER-Object by an own 
> Extension.

Good :)

> The Gifbuilder looks like (snippet):
>     10 = TEXT
>     10.text.field = header
>     10.text.listNum.splitChar = |
>     10.text.listNum = 0
>     10.fontFile = fileadmin/myfont.otf
>     10.fontSize = 32
>     10.offset = 0,32
>     10.fontColor < plugin.tx_mftest_pi1
>     10.fontColor.select = green

Take a look to TSRef and read what fontColor is. Even if you do "< 
plugin.tx_mftest_pi1" it will not make it USER. It will stay 
"GraphicColor /stdWrap" as described in TSRef [1] but will not work at 
all because now it will contain a string "USER", which is invalid.

I think you did not get that TS is not execution but configuration 
language. When you do "10.fontColor < plugin.tx_mftest_pi1", you do not 
copy result of "plugin.tx_mftest_pi1" to fontColor but copy all 
properties of it! This TS becomes:

10.fontColor = USER
10.fontColor.userFunc = ...

and this has no meaning at all. It would, if fontColor had cObject type.

What you need here is the fact that fontColor is stdWrap and stdWrap can 
include cObjects!

Thus you should use this code:

10.fontColor.stdWrap.cObject < plugin.tx_mftest_pi1

and it will work.

-- 
Dmitry Dulepov
http://typo3bloke.net/

"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)




More information about the TYPO3-dev mailing list