ModifyTypoScriptConfigEvent

New in version 13.0

This event has been introduced to serve as a direct replacement for the removed $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc'] hook.

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:

$request->getAttribute('frontend.typoscript')->getConfigArray()
Copied!

Example

API

class \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 ( )
returntype

Psr\Http\Message\ServerRequestInterface

getSetupTree ( )
returntype

TYPO3\CMS\Core\TypoScript\AST\Node\RootNode

getConfigTree ( )
returntype

TYPO3\CMS\Core\TypoScript\AST\Node\RootNode

setConfigTree ( TYPO3\\CMS\\Core\\TypoScript\\AST\\Node\\RootNode $configTree)
param TYPO3\\CMS\\Core\\TypoScript\\AST\\Node\\RootNode $configTree

the configTree