[TYPO3-english] Including typoscript templates through setup field?`

Christopher Torgalson bedlamhotel at gmail.com
Mon Feb 23 16:29:40 CET 2009


Hi there,

On Mon, Feb 23, 2009 at 1:26 AM, Stig Nørgaard Færch <snf at dkm.dk> wrote:
> I know it's possible to include typoscript from typoscript setup through
> <INCLUDE_TYPOSCRIPT:somefile>.
>
> What I'm looking for is the possibility to include typoscript templates
> (sys_template) conditionally.
>
> Let's say that some constant is set to 1, then I want template A to be
> included.
> If the constant is set to 2, then I want tempalte B to be included.
>
> Is this somehow possible?

As far as I know, you can't do this. I may be missing something, but I
don't really see the need--define two lib objects and use a CASE
cObject to decide which to use in your rendering:

lib.A = COA
lb.A { ... }

lib.B = COA
lib.B { ... }

content = CASE
content {
  key = {$someConstant}

  default < lib.A

  value_a < lib.A

  value_b < lib.B
}


I may have overlooked a situation where just conditionally including
the TS is preferable, but your message was a little light on details
:)

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


More information about the TYPO3-english mailing list