TYPO3 Insert records element: detect number of items

477 Views Asked by At

Is there any way to detect in fluid or typoscript (or anything else) if an "Insert Records" CE from fluid_styled_content contains one or multiple items?

The use case:

I use "insert records" to display contacts from a custom extbase extension on a page, and I'd like to get a different title and layout if there are one or several items.

1

There are 1 best solutions below

2
On BEST ANSWER

Insert Records is rendered using the RECORDS content object. In \TYPO3\CMS\Frontend\ContentObject\RecordsContentObject::render() I see no option to read the number of items or the current item number that is rendered from the contentObjectRenderer object that renders a single item.