AfterGetDataResolvedEvent

New in version 13.0

This event serves as a drop-in replacement for the removed hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getData']. In comparison to the removed hook, the event is not dispatched for every section of the parameter string, but only once, making the former $secVal superfluous.

The PSR-14 event \TYPO3\CMS\Frontend\ContentObject\Event\AfterGetDataResolvedEvent is being dispatched just before ContentObjectRenderer->getData() is about to return the resolved "data".

Example

EXT:my_extension/Classes/Frontend/EventListener/MyEventListener.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Frontend\EventListener;

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Frontend\ContentObject\Event\AfterGetDataResolvedEvent;

#[AsEventListener(
    identifier: 'my-extension/my-event-listener',
)]
final readonly class MyEventListener
{
    public function __invoke(AfterGetDataResolvedEvent $event): void
    {
        $event->setResult('modified-result');
    }
}
Copied!

New in version 13.0

The PHP attribute \TYPO3\CMS\Core\Attribute\AsEventListener has been introduced to tag a PHP class as an event listener. Alternatively, you can also register an event listener via the Configuration/Services.yaml file. Have a look into the section Implementing an event listener in your extension.

API

class AfterGetDataResolvedEvent
Fully qualified name
\TYPO3\CMS\Frontend\ContentObject\Event\AfterGetDataResolvedEvent

Listeners are able to modify the resolved ContentObjectRenderer->getData() result

getResult ( )
Returns
?mixed
setResult ( ?mixed $result)
param $result

the result

getParameterString ( )
Returns
string
getAlternativeFieldArray ( )
Returns
array
getContentObjectRenderer ( )
Returns
TYPO3CMSFrontendContentObjectContentObjectRenderer