ModifyRecordOverlayIconIdentifierEvent
The PSR-14 event
\TYPO3\
allows extension authors to modify the overlay icon identifier of any record
icon. Extensions can listen to this event and perform necessary modifications
to the overlay icon identifier based on their requirements.
Example: Set an overlay icon for the records of a custom table
EXT:my_extension/Classes/Core/EventListener/ModifyRecordOverlayIconIdentifierEventListener.php
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Imaging\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\Imaging\Event\ModifyRecordOverlayIconIdentifierEvent;
#[AsEventListener(
identifier: 'my-extension/imaging/modify-record-overlay-icon-identifier',
)]
final readonly class MyEventListener
{
public function __invoke(ModifyRecordOverlayIconIdentifierEvent $event): void
{
if ($event->getTable() === 'tx_myextension_domain_model_mytable') {
$event->setOverlayIconIdentifier('my-overlay-icon-identifier');
}
}
}
API
-
final class
ModifyRecordOverlayIconIdentifierEvent -
- Fully qualified name
-
\TYPO3\CMS\ Core\ Imaging\ Event\ Modify Record Overlay Icon Identifier Event
Listeners to this event are able to modify the overlay icon identifier of any record icon