Feature #106299
closedMake ViewMode Dropdown in RecordListController extendable with PSR-14 event
0%
Description
Since quite a time, there is a RenderAdditionalContentToRecordListEvent available to add addtional infos above and below of a record list.
Since this opens the possibility to add eg. custom record filters, it would be really nice to offer the user an option to switch them on or off as well.
The perfect place to do so (IMO) would be the ViewMode-Dropdown-Menu in the right corner of the record list view.
Currently this menu is limited to switch on/off the search and clipboard.
This could be easily made extendable by adding a PSR-14 event dispatcher right after the $viewModeItems array was filled (~ Line 405) inside the getDocHeaderButtons method of vendor/typo3/cms-backend/Classes/Controller/RecordListController.php
If this event were to receive the elements already added, the request, the $this->moduleData object and the $this->modTSconfig array, the possibilities would be (almost) endless.
Of course, a method must also be integrated that returns the (modified/extended) elements.
Updated by Georg Ringer 2 months ago
- Status changed from New to Rejected
please use the event \TYPO3\CMS\Backend\Template\Components\ModifyButtonBarEvent
this works quite fine
Updated by Alexander Grein 2 months ago
You are right, it is possible to add eg. a new dropdown item to the view menu this way.
Unfortunately, the event mentioned contains neither the request object nor anything from the module object.
This way it is very difficult to eg. visualize the state of a button with an check icon, like the other two items ("Show search", "Show clipboard") do.
Updated by Georg Ringer 2 months ago
you can use $GLOBALS[TYPO3_REQUEST]
.
looking at RecordListController
, moduleData is derived from the request, just like the id which is used to fetch modTSconfig