[TYPO3] Problems concerning if-statement

JoH info at cybercraft.de
Wed May 24 10:48:05 CEST 2006


> 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
}

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
}


> Problems
> 1) If i put the date inside the if-statement I get raw data. If I put
> after the if-statement is ignored
>
> 2) in menus I must make the cObject for all levels - copy seems not to
> work - it this generic problem with if-statements?

Could you tell us how you made the "copy"?
Usually copying stuff from one menu level to another works quite well.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de





More information about the TYPO3-english mailing list