Issue Feature Under Review Stale

#110435PSR-14 event to render additional content in the filelist module

Konrad Michalik 08/11/26, 10:18 updated 09/17/26, 14:47

Description

`RenderAdditionalContentToRecordListEvent` allows extensions to render content above and below the record list. The filelist module has no equivalent. `FileListController` does not dispatch any event at all and has no `EventDispatcherInterface` injected.

This is an inconsistency rather than a missing feature in one specific place: the page module, the record list and (with the proposal in #110434 ) the edit form all offer a way to contribute content, the file module does not. Extensions that decorate backend modules consistently have to special case the filelist and fall back to response manipulation.

Use case: EXT:xima_typo3_content_planner renders editorial status information in the page module, the record list and the edit form. For the filelist it uses a middleware for that single case.

https://docs.typo3.org/p/xima/xima-typo3-content-planner/main/en-us/Usage/StatusChange.html#record-list

Proposal: `RenderAdditionalContentToFileListEvent`, modelled directly on `RenderAdditionalContentToRecordListEvent` (`getAdditionalContentAbove()` / `setAdditionalContentAbove()`, same for below), dispatched in `FileListController::processRequest()` and assigned to the template as `additionalContentTop` / `additionalContentBottom`.

Open question for the patch: `FileListController` has a second, earlier return in `handleRequest()` for the case where the folder object is null (invalid request or missing permissions). Whether the event should fire there as well is a design decision, dispatching only in `processRequest()` is the simpler option.

I am willing to provide the patch.

Reviews 1

History 25

  1. Konrad Michalik commented <span data-processor="relativetime" data-value="2026-08-12T12:43:59+00:00" > 08/12/26, 12:43 </span>

    Two deviations from the proposal above, plus one finding worth recording.

    Naming : the event is called BeforeFileListIsRenderedEvent, not RenderAdditionalContentToFileListEvent. Of the event classes added to Core since mid-2025, eleven use a Before and seven an After prefix, while none follows the older pattern of RenderAdditionalContentToRecordListEvent, which stems from the v11 hook migration. The decisive argument was the neighbouring class in the same directory: AfterFileListRowPreparedEvent already follows the current scheme, so mirroring the record list name would have made the new event the outlier in its own namespace.

    The event carries the folder . Besides the request it exposes getFolder(): Folder. Without it, every listener has to read the id query parameter and resolve it through StorageRepository itself. The getter is not nullable, because the dispatch sits in processRequest() and handleRequest() returns earlier when no folder could be resolved. Listeners therefore need no null check.

    That early return also answers the open question above. The event fires only when a folder is actually displayed, not for invalid requests or missing read permissions. In those cases the module renders an empty container plus a flash message, so there would be no folder for a listener to relate its content to. This matches RecordListController, which likewise dispatches only in its normal path.

    One qualification on the use case : for the file list the new event covers less than the equivalent events do in the other modules. EXT:xima_typo3_content_planner can replace its folder status header with a listener, but the status dropdowns it injects into individual rows need AfterFileListRowPreparedEvent instead. Both together remove the need for response manipulation in this module, while this patch alone reduces it.

    The additional content is rendered below the module headline and around the listing, mirroring the position of additionalContentTop and additionalContentBottom in the record list. Escaping dynamic values is the responsibility of the listener, since the content is rendered as raw markup. A functional test and a changelog entry are included.