[TYPO3] count tt_news records

Roberto Torresani erreti at gmail.com
Thu Dec 20 13:01:13 CET 2007


Hi Francois!

2007/12/19, Francois Suter <fsuter at cobweb.ch>:
>
> so you should have something like:
>
> page.10.subparts.CONTENT = TEXT
> page.10.subparts.CONTENT {
>         value = Content to display if there are fewer than 3 news items.
>         if {
>                 value {
>                         numRows  {
>                                 table = tt_news
>                         }
>                 }
>                 isLessThan = 4
>         }
> }


This my solution:

page.10.subparts.CONTENT = COBJ_ARRAY
page.10.subparts.CONTENT.10 < styles.content.get

page.10.subparts.CONTENT.20 = CONTENT
page.10.subparts.CONTENT.20 {
  table = tt_content
  select {
    pidInList = 2 --> page od the contents
  }
  stdWrap.if {
    isLessThan.numRows {
      table = tt_news
      select.pidInList = 4 --> Sysfolder of news
    }
    value = 2  --> Number of news
  }
}


Thanks for your tips!

Roberto


More information about the TYPO3-english mailing list