[TYPO3-dev] how to implement "no records found" with TS

Peter Niederlag niederlag at ikd01.de
Mon Jul 10 18:45:48 CEST 2006


Hi,

Martin Kutschker schrieb:
> Hi!
> 
> I tried to display a message if a CONTENT object didn't render any
> records.  I didn't want to use a further SELECT (eg via stdWrap.numRows)
> for performance reasons. I fiddled with cobj:parentRecordNumber with no
> success.
> 
> So I changed tlib_cObj:
> 
> function getData($string,$fieldArray)    {
> ...
[...]
> Is this possible (without any additional SELECT!) without this hack?

Well, you can use another TS-hack. ;)

page {
    20 = COA
    20 {
      50 < styles.content.get
      50.stdWrap.ifEmpty = <h2>testme</h2>
      wrap = <div id="content">|</div>
    }
}

The only problem is that 'ifEmpty ' returns false if you have applied
some wrap on the same TS-object. That's why you need that extra COA around.

> If not, do you think 'currentRecordTotal' should be added to getData?

IMO this should go into a register, if its not there already, shouldn't it?

Groetjes,
Peter
-- 
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *
http://www.typo3partner.net * professional services network *




More information about the TYPO3-dev mailing list