[Typo3] Using globalVar = TSFE: for content-elements

JoH info at cybercraft.de
Wed Jun 8 14:24:59 CEST 2005


> I would like to control wrapping on an content-element basis so I
> created a tiny extension which add an extra checkbox to the
> tt_content-table. This will add flexibility to my templates as the
> condition can be changed "per content-element".
> temp.contentRightRepeat {
> ...
>      [globalVar = TSFE:tt_content|tx_bendoo_extra_checkbox = 0]
>       renderObj.stdWrap.wrap = AAA|BBB
>      [else]
>       renderObj.stdWrap.wrap = CCC|DDDD
>      [end]
> }
>
> However, this condition
>   [globalVar = TSFE:tt_content|tx_bendoo_extra_checkbox = 0]
> ... does not work.
>
> I guess this is not the correct way to call a field from the
> tt_content-table.
>
> Any suggestions how I could this get working?

1. As you might have found by googling for "conditions typo3": NO conditions
INSIDE curly brackets!
2. You should use a TS-Object CASE for this purpose. There you can set your
field as a key field to decide what to do.

so it's:

renderObj = CASE
renderObj {
    key.field = tx_bendoo_extra_checkbox
    default = WHATEVER
    default {
        blah
    }
    1 = WHATEVER
    1 {
        blah
    }
}

Not tested but should be working.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau





More information about the TYPO3-english mailing list