[TYPO3-english] userFunc condition

Pero Matic takoje at takoje.hr
Wed Sep 9 11:34:55 CEST 2009


Thx. Dmitry now it's more clear. This should be put in manual :-) The key 
thing is this:

if IF returns false then stdWrap = ''
if stdWrap = '' then TEXT.value is empty (or something like that but all in 
all nothing is displayed)

Regards.


"Dmitry Dulepov" <dmitry.dulepov at gmail.com> wrote in message 
news:mailman.1.1252432553.2294.typo3-english at lists.netfielders.de...
> Hi!
>
> Pero Matic wrote:
>> Can you please (or someone else) then explain me this. I can't get it 
>> from
>> doc. When i have ie some object like this
>>
>> 20 = COA
>> 20.10 something bla bla
>> 20.20 bla bla
>> 20.30 if {
>>     value = foo
>>     equals = bar
>>     negate = 1
>> }
>>
>> Does this mean that if condition is false than object 20 will not exist 
>> or
>> i'm totaly in different universe?
>
> The object will always exists. Whether it shows anything or not, depends 
> on the object. Some object even do not have "if" property.
>
> Here is how you "decode" it using TSRef. You look to object's type. 
> Suppose that:
>
> 20.30 = TEXT
> 20.30 {
> if {
> equals = bar
> negate
> value = foo
> }
> value = House M.D
> }
>
> So you got TEXT. You look to TSRef at [1] and see that it has "value" and 
> "the stdWrap is on the very rootlevel of the object". It is clear about 
> "value", so stdWrap remains.
>
> Next you go to stdWrap at [2] and look for "if". It says two things. 
> Firsts it is "->if", which means you need to look up "if" in TSRef. 
> Secondly, stdWrap will return an empty string if result of the "if" is 
> false. if stdWrap returns empty result, TEXT will return empty result.
>
> Next we go and look to "if" at [3] and see that "equals" returns false if 
> it is not equal to "value". In your case it is not equal, so the result 
> should be "false". But there is also "negate", which negates false to true 
> and "if" returns true. This means that the TEXT object will display the 
> content of the "value", which "House M.D".
>
> Now change the first line from TEXT to HTML. There will be absolutely not 
> effect of the "if" because there is no stdWrap on the root level and "if" 
> is not processed at all. See how it works?
>
> [1] 
> http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.2.1/view/1/8/#id4365499
> [2] 
> http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.2.1/view/1/5/#id4269096
> [3] 
> http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.2.1/view/1/5/#id4289528
>
> -- 
> Dmitry Dulepov
> Facebook: http://www.facebook.com/dmitryd
> Twitter: http://twitter.com/dmitryd
> Skype: liels_bugs 




More information about the TYPO3-english mailing list