[TYPO3] TS Conditions
Antonio Willybiro
keiser_soze at hotmail.com
Fri Dec 29 23:11:06 CET 2006
Thanks for your answer.
The thing I would be missing is the 'elseif' for all other pages
Any idea about that?
Cheers,
Antonio
"Christopher Torgalson" <bedlamhotel at gmail.com> wrote in message
news:mailman.51530.1167423094.21325.typo3-english at lists.netfielders.de...
> Hi,
>
> On 12/29/06, Antonio Willybiro <keiser_soze at hotmail.com> wrote:
>> Hi there,
>>
>> How would you make that statement:
>> "If pageid=1 then lib.foo = aaa BUT IF pageid=2 then lib.foo = bbb ELSE
>> lib.foo = ccc"
>
>
> The easy way is like this [1]--if the conditions are mutually exclusive:
>
> [globalVar = TSFE:id=1]
> lib.foo = aaa
> [globalVar = TSFE:id=1]
> lib.foo = bbb
> [global]
>
> You could also do the same with 'if' [2] in, for example, a COA, but
> it gets to be pretty untidy code pretty quickly:
>
> lib.foo = COA
> lib.foo {
> # Output 'foo' if page id = 1
> 5 = HTML
> 5 {
> value = foo
> value {
> if {
> value = 1
> equals.data = TSFE:id
> }
> }
> }
>
> # Output 'bar' if page id = 2:
> 10 = HTML
> 10 {
> value = bar
> value {
> if {
> value = 2
> equals.data = TSFE:id
> }
> }
> }
> }
>
> --
> Christopher Torgalson
>
>
> [1]
> http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/4/1/
> [2]
> http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/5/7/
More information about the TYPO3-english
mailing list