[TYPO3-english] advanced typoscript wrapping needed

Walrick lists at globalhealingcircle.net
Fri May 1 10:55:21 CEST 2009

JoH asenau wrote:

> But outerWrap would still be your friend:
> blah.outerWrap.cObject = CASE
> blah.outerWrap.cObject {
>     key {
>         field = fe_group
>         split {
>             token = ,
>             cObjNum = 1
>             1.current = 1
>             1.wrap = G|
>         }
>     }
>     default = TEXT
>     default.value = <some>|</wrap>
>     G1 = TEXT
>     G1.value = <some>wrap</for><group>|</1>
>     G1G-2 = TEXT
>     G1G-2.value = <some>wrap</for><group>|</1and-2>
> }
> Key uses the fe_group field and splits it by comma to get multiple groups as
> well.
> Since you are not allowed to use ,  as a key in PHP arrays this is replaced
> with a G, generating a chain of GxGyGz.
> This can be used to assign TEXT elements to the the different cases. You
> just have to make sure you get all the possible combinations of groups as
> GxGyGz. Any other will be rendered with default. And you must put the |
> character into the value, since the whole value will be used as "the
> outerWrap" later on.

Hello Joey,

Using outerWrap seems a better solution indeed. I was looking for
something which could do this, but couldn't find it.

Questions: What's the advantage of using CASE/key instead of the COA/if
method? Does it change anything in the way the output is produced or is
it just another way of getting the same result? (Or does the COA method
not work at all with outerWrap.cObject?)

Having had a quick look ad TSREF it does seem to me that using CASE is a
way more intended for this kind of issue then using COA.

Always nice to learn something new. Will surely try this soon.



webmaster Global Healing Circle

More information about the TYPO3-english mailing list