AfterTemplatesHaveBeenDeterminedEvent
The PSR-14 event
\TYPO3\
can be used to manipulate
sys_ rows. The event receives the list
of resolved
sys_ rows and the
\Psr\ and allows manipulating the
sys_ rows array.
The event is called in the code of the Sites > TypoScript backend module, for example in the submodule Included TypoScript, and in the frontend.
Extensions using the old hook that want to stay compatible with TYPO3 v11 and v12 can implement both the hook and the event.
Example
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\TypoScript\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\TypoScript\IncludeTree\Event\AfterTemplatesHaveBeenDeterminedEvent;
#[AsEventListener(
identifier: 'my-extension/post-process-sys-templates',
)]
final readonly class MyEventListener
{
public function __invoke(AfterTemplatesHaveBeenDeterminedEvent $event): void
{
$rows = $event->getTemplateRows();
// ... do something ...
$event->setTemplateRows($rows);
}
}
API
- class AfterTemplatesHaveBeenDeterminedEvent
-
- Fully qualified name
-
\TYPO3\
CMS\ Core\ Typo Script\ Include Tree\ Event\ After Templates Have Been Determined Event
A PSR-14 event fired when sys_template rows have been fetched.
This event is intended to add own rows based on given rows or site resolution.