AfterFileListRowPreparedEvent
New in version 15.0
See Feature: #110259 - New PSR-14 AfterFileListRowPreparedEvent.
The PSR-14 event
\TYPO3\
is fired after a file or folder row has been fully prepared for the
Media module, just before it is rendered into the final table
row markup.
Unlike ProcessFileListActionsEvent,
which only allows the action icons in the control column to be modified, this
event provides access to the already-rendered data of every column in the
row (for example name, size or any additional metadata columns added
via the column selector), as well as the row's HTML tag attributes. This
mirrors the equivalent event that is already available for the classic record
list:
After.
Example: decorate a column value in the file list
The following listener decorates the already-rendered values of columns in each row, without having to resort to hooks or class-name-based reflection workarounds.
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\FileList\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Filelist\Event\AfterFileListRowPreparedEvent;
#[AsEventListener(
identifier: 'my-extension/decorate-file-list-column',
)]
final readonly class DecorateFileListColumnEventListener
{
public function __invoke(AfterFileListRowPreparedEvent $event): void
{
$data = $event->getData();
// Modify the already-rendered value of a specific column
$data['my_column'] = 'My custom value';
$event->setData($data);
}
}