[TYPO3] Problems concerning if-statement

Tapio Markula tapio.markula at dnainternet.net
Wed May 24 11:57:03 CEST 2006


JoH wrote:
>>It seems that I never understand explanations in
>>
> 
> http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/5/7/
> 
>>Because I don't properly understand the page (IMO not good examples),
>>I need some help.
>>
>>I can't understand on the base of the documentation, how
>>conditions change the result.
>>
>>My TS, which purpose is to render date only if the
>>value lastUpdated is not zero
>>
>>20=TEXT
>>20{
>>field=lastUpdated
>>
>>if{
>>value.data = 0
>>equals.field = lastUpdated
>>negate=1
>>}
>>
>>date=d.m.Y
>>
>>}
> 
> 
> 
> 20 = TEXT
> 20 {
>     fieldRequired = lastUpdated
>     field = lastUpdated
>     date = d.m.Y
> }
> 
> or if you want to do it with "if"
> 
> 20 = TEXT
> 20 {
>     if.isTrue.field = lastUpdated
>     field = lastUpdated
>     date = d.m.Y
> }

tested- worked. Thank's

> There is even a proper syntax for your approach:
> 
> 20 = TEXT
> 20 {
>     if {
>         value = 0
>         equals.field = lastUpdated
>         negate = 1
>     }
>     field = lastUpdated
>     date = d.m.Y
> }

In fact my trial was close - i had put 'value.data',
which was in one example - a small mistake but prevented that to work.

The order was not relevant because

field=lastUpdated
if{
value = 0
equals.field = lastUpdated
negate=1
}
date=d.m.Y

works too.
In fact I would need else-statement too (to print ' - ' if the value is '0')

>>2) in menus I must make the cObject for all levels - copy seems not to
>>work

> Usually copying stuff from one menu level to another works quite well.

I had a syntax error with }



More information about the TYPO3-english mailing list