[TYPO3-english] advanced typoscript wrapping needed

Christopher Torgalson bedlamhotel at gmail.com
Thu Apr 23 16:26:50 CEST 2009


Hi,

On Thu, Apr 23, 2009 at 4:41 AM, Walrick <lists at globalhealingcircle.net> wrote:

<snip>

>> Looking at your TS i found a lot of unbalanced wrappings.
>> Normaly you can nest elements so the wrapping is done in a propper way
>> having opening and closing tag in the same wrap .
>
> You are right.
>
> But the problem with nested normal wraps combined with the if-statement
> is (in my experience): if the statement returns false not only is the
> wrap not applied but everything inside it, both further wraps and the
> actual content of the element, disappear as well, which leads to empty
> pages. Not good.
>
> The best way would have been that depending on conditions either wrap 1
> (public), wrap 2 (membersonly) or wrap 3 (ctonly) gets applied.
>
> A kind of If ... elseif ... else ...
>
> But the typoscript-if does not seem to have an else option.


Just needs a little imagination.

lib.something = COA
lib.something {
  # Render only if condition 1 is true:
  5 = TEXT
  5 { ... }

  # Render only if condition 2 is true
  10 = TEXT
  10 { ... }

  # Render only if condition 3 is true:
  15 = TEXT
  15 { ... }
}


-- 
Christopher Torgalson
http://www.typo3apprentice.com/


More information about the TYPO3-english mailing list