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

JoH info at cybercraft.de
Mon Jul 10 21:12:46 CEST 2006


> 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.

Good idea.

> I fiddled with
> cobj:parentRecordNumber with no success.

> Then I was able to use this in my TS:
>
> subparts.colNormal < styles.content.get
> subparts.colNormal.stdWrap.append = TEXT
> subparts.colNormal.stdWrap.append.if.isFalse.data =
> cobj:currentRecordTotal subparts.colNormal.stdWrap.append.value =
> <b>No records found</b>
>
> Is this possible (without any additional SELECT!) without this hack?
>
> If not, do you think 'currentRecordTotal' should be added to getData?

You could try it the other way around and set the value as a default:

subparts.colNormal = TEXT
subparts.colNormal {
    value = <strong>No records found</strong>
    override.cObject < styles.content.get
}

Not tested though ...

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de






More information about the TYPO3-dev mailing list