Feature: #101818 - BeforeLoadedPageTsConfigEvent
See forge#101818
Description
The PSR-14 event \TYPO3\
can be used to add global static page TSconfig before anything else is loaded.
This is especially useful, if page TSconfig is generated automatically as a
string from a PHP function.
It is important to understand that this config is considered static and thus should not depend on runtime / request.
Example
<?php
namespace Vendor\MyExtension\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\TypoScript\IncludeTree\Event\BeforeLoadedPageTsConfigEvent;
#[AsEventListener(identifier: 'vendor/my-extension/global-pagetsconfig')]
final class AddGlobalPageTsConfig
{
public function __invoke(BeforeLoadedPageTsConfigEvent $event): void
{
$event->addTsConfig('global = a global setting');
}
}
Copied!
Impact
Developers are able to define an event listener which is dispatched before any other page TSconfig is loaded.