ModifyTypoScriptConfigEvent

New in version 13.0

The PSR-14 event \TYPO3\CMS\Frontend\Event\ModifyTypoScriptConfigEvent allows listeners to adjust and react on TypoScript config.

This event is dispatched before final TypoScript config is written to the cache, and not when a page can be successfully retrieved from the cache, which is typically the case in "page is fully cached" scenarios.

This incoming $configTree has already been merged with the determined PAGE page.config TypoScript of the requested type / typeNum and the global TypoScript setup config.

The result of this event is available as a request attribute:

$configArray = $request->getAttribute('frontend.typoscript')->getConfigArray();
$configTree = $request->getAttribute('frontend.typoscript')->getConfigTree();
Copied!

Example

API

class ModifyTypoScriptConfigEvent
Fully qualified name
\TYPO3\CMS\Frontend\Event\ModifyTypoScriptConfigEvent

This event allows listeners to adjust and react on TypoScript 'config'.

This event is dispatched before final TypoScript 'config' is written to cache, and not when a page can be successfully retrieved from cache, which is typically the case in 'page is fully cached' scenarios.

This incoming $configTree has already been merged with the determined PAGE "page.config" TypoScript of the requested 'type' / 'typeNum' and the global TypoScript setup 'config'.

The result of this event is available as Request attribute: $request->getAttribute('frontend.typoscript')->getConfigTree(), and its array variant $request->getAttribute('frontend.typoscript')->getConfigArray().

Registered listener can set a modified setup config AST. Note the TypoScript AST structure is still marked @internal within v13 core and may change later, using the event to write different 'config' data is thus still a bit risky.

getRequest ( )
Returns
\Psr\Http\Message\ServerRequestInterface
getSetupTree ( )
Returns
\TYPO3\CMS\Core\TypoScript\AST\Node\RootNode
getConfigTree ( )
Returns
\TYPO3\CMS\Core\TypoScript\AST\Node\RootNode
setConfigTree ( \TYPO3\CMS\Core\TypoScript\AST\Node\RootNode $configTree)
param $configTree

the configTree