[TYPO3-templavoila] Conditionals in Data Structure

Ron Hall ron at busynoggin.com
Thu Sep 7 14:29:21 CEST 2006


To help close this thread. After even more searching, I started from scratch
to my testing between code in a regular ts template and the ts in the
typoscript field in Templa.

I have not been able to get the [globalVar] conditional to work. However, I
have been able to figure out how the stdWrap "if" conditional should work.

Originally, I was writing something like this which does not work:

10 = COA
10.if {
value = {$myConstant}
equals = on
}
10.value = This will only display if condition is true

I should have been writing this which works:

10 = COA
10.if {
value = {$myConstant}
equals = on
}
10.10 = HTML
10.10.value = This will only display if condition is true

Thanks,
Ron Hall


On 9/6/06 9:47 AM, "Ron Hall" <ron at busynoggin.com> wrote:

> Thank you for the response but I know how to get constants into my template.
> That is not the problem.
> 
> My issue is with the use of conditionals. I can get them to work in ts
> templates but not in typoscript in TV data structures.
> 
> I need insight on the use of {global_Var]  or the "if" conditional My
> imaginary examples again are:
> 
> 10 = TEXT
> 10.value = Include this text if condition is true
> 10.if {
>     value = {$myConstant}
>     equals = on
>     }
> 
> Or even better something like this:
> 
> 
> 10 = TEXT
> 10.value = Include this if condition IS NOT met
> [globalVar = TSFE:page | uid = {$myConstant}]
> 10.value = Include this if condition IS met
> [global]
> 
> My question is: Can conditionals be used within the ts in data structures?
> If so, con someone give me a working example so I can compare my code and
> figure out the problem.
> 
> I have done much searching on tv list, tv manual, futuristic template
> building and google but have yet to see anything about using conditionals in
> this setting.
> 
> Any insight is appreciated.
> 
> Thanks again,
> Ron Hall
> 
> 
> On 9/6/06 1:08 AM, "Dmitry Dulepov [typo3bloke.net]" <typo3 at accio.lv> wrote:
> 
>> Hi!
>> 
>> Ron Hall wrote:
>>> Anyone have any insight into this?
>> 
>> Constants in DS must be accessed differently than in TS setup. This
>> happens because TS in DS is a separate unit. Constants in main TS belong
>> to that main TS.
>> 
>> You need to let TV know which constants you want to use. You do it in
>> the main template. There you have:
>> page.10 = USER
>> page.10.userFunc = tx_templavoila_pi1->main_page
>> Add line there for each constant:
>> page.10.TSconst.myconst = {$myconst}
>> Notice that only one levelconstatnts cn be used this way. I.e. you
>> cannot have "page.10.TSconst.myconst.myvalue" there.
>> 
>> Btw, it is all in the manual.
> 
> 
> _______________________________________________
> TYPO3-project-templavoila mailing list
> TYPO3-project-templavoila at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-templavoila





More information about the TYPO3-project-templavoila mailing list