Project

General

Profile

Actions

Feature #79350

closed

Make "RECORDS" know more about it's contents

Added by Urs Braem over 7 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Frontend
Start date:
2017-01-17
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

As far as I can see, the INSERT RECORDS content element renders each record individually.

So a rendered record has no knowledge if there are others in the same CE. And there is no master container for the CE that knows about it's children. Correct?

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

Would it be possible to make that CE more "gnostic" of its contents?
- Maybe pass along that information (how many records are being rendered) with a wrapper to the entire CE?
- Or in addition to rendering each record individually, return the data in an array that has the rendered content as well as the raw data?

I'm not sure if there are implications that prohibit this, so I thought I'd ask.

Cheers
Urs

PS This preceded the ticket
http://stackoverflow.com/questions/41598570/typo3-insert-records-element-detect-number-of-items/

Probably referring to those
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/RecordsContentObject.php
http://api.typo3.org/typo3cms/7/html/_records_content_object_8php_source.html

Actions #1

Updated by Georg Ringer about 7 years ago

  • Target version changed from 8 LTS to 9 LTS

IMO the best approach would be to use a custom dataprocessor/viewhelper which gets you the information you need. I am not sure if this feature should make it into the core, therefore I leave the issue open.

Actions #2

Updated by Urs Braem about 7 years ago

Thanks! Good idea with the VH!

Actions #3

Updated by Mona Muzaffar almost 7 years ago

  • Status changed from New to Needs Feedback

@Urs Bream do you think this feature should still make it into the core or is it solved by using a custom viewhelper?

Actions #4

Updated by Urs Braem almost 7 years ago

@Mona As in so many cases, I haven't gone further. So on a personal level, I can't really say yes.
On a conceptual level, I think so, yes. But that's up to the core team

Actions #5

Updated by Mona Muzaffar almost 7 years ago

  • Status changed from Needs Feedback to New
Actions #6

Updated by Mona Muzaffar almost 7 years ago

  • Category set to Content Rendering
Actions #7

Updated by Susanne Moog over 6 years ago

  • Category changed from Content Rendering to Frontend
Actions #8

Updated by Susanne Moog over 5 years ago

  • Target version changed from 9 LTS to Candidate for Major Version
Actions #9

Updated by Susanne Moog over 1 year ago

  • Status changed from New to Closed

As far as I can see, this is actually already possible.

When rendering insert records elements, the cObj has a key "parentRecord" which contains the database row of the insertRecord element. That in turn contains (in source) the list of elements to be rendered, therefor we know both how many and which elements are rendered.

If there is anything still missing, please let us know.

Actions

Also available in: Atom PDF