[Typo3] tt_news: specially marking new news items

Charles Rector crector at iexposure.com
Fri May 6 17:18:55 CEST 2005


I'm trying to wrap the title of a news item if it is less than a day 
old. I've been trying a lot of different variations, but it looks like 
my typoscript skills aren't that great yet. :-)

Here's what I've currently been tinkering with:

plugin.tt_news {
   displayList.title_stdWrap {
     wrap = <span style="color:red; font-weight: bold">New!</span>&nbsp;|
     if {
       value.data = date:U - field:datetime
       isLessThan = 1*60*60*24
     }
   }
}

 From what I've read in the documentation, date:U is the current date, 
and field:datetime should be the date you enter for each news item. I've 
also read that the dates are stored in a UNIX format, where 1*60*60*24 
equals one day. I'm trying to get the difference between the current 
date and the date of the news item somehow, but right now it seems to 
wrap every single item, regardless of age.

I also noticed that when the ifLessThan evalutes to false, I end up with 
no title at all!

A little help? ^_^



More information about the TYPO3-english mailing list