[TYPO3] An exampe of usage of if-statement

Peter Klein peter at umloud.dk
Thu Jun 8 10:53:17 CEST 2006


Hi Tapio. I have told you this before. You need to READ the TSRef correctly, 
otherwise you'll never learn it.

In your example you do something like this (I assume that "1" is either a 
TMENU or a GMENU object.):

 1.if {
     value.data = date:U
     isLessThan.field = newUntil
     negate = 0

}

>From READING TSRef, you'll see that none of the TMENU/GMENU objects has any 
"if" properties.
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/10/1/
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/10/7/
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/10/4/

So that's why your examples doesn't work..

-- 
Peter Klein/Umloud Untd


"Tapio Markula" <tapio.markula at dnainternet.net> skrev i en meddelelse 
news:mailman.1.1149750449.562.typo3-english at lists.netfielders.de...
> Hi
>
> TS REF has this example
>
> This is a GIFBUILDER object that will write "NEW" on a menu-item if the 
> field "newUntil" has a date less than the current date!
>
> ...
>
>   30 = TEXT
>
>   30.text = NEW!
>
>   30.offset = 10,10
>
>   30.if {
>
>     value.data = date: U
>
>     isLessThan.field = newUntil
>
>     negate = 1
>
>   }
> in
> http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/5/7/
>
> Well I tried that for menu states
>
>
> tt_content.menu.20.5 {
> special {
>                         limit = 10000 maxAge = 360000*24*183
> }
>
> 1.NO=0
>
> 1.if {
>     value.data = date:U
>     isLessThan.field = newUntil
>     negate = 0
>
> }
>
> 1.NO=1
> 1.alternativeSortingField=newUntil,lastUpdated,tstamp,uid
> 1.NO.after.cObject < temp.after }
>
>
> The condition doesn't have any effect.
> I got some condition to work with TEXT object,
> for example
>
> 11=TEXT
> 11{
> field=lastUpdated
>
> if{
> value = 0
> equals.field = lastUpdated
> negate=1
> }
> date=d.m.Y
> }
>
> But I don't now figure, what's wrong with menu items 





More information about the TYPO3-english mailing list