ModifyTypoScriptConfigEvent
New in version 13.0
This event has been introduced to serve as a direct replacement for the removed
$GLOBALS
hook.
The PSR-14 event \TYPO3\
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 $config
has already been merged with the determined
PAGE page.
TypoScript of the requested type
/
type
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();
Caution
Registered listeners can set a modified setup config
AST. Note the TypoScript AST structure is
still marked internal within TYPO3 v13 and may change later, using the
event to write different config
data is thus still a bit
risky.
Example
Note
Currently, we do not have an example for this event. If you can provide a useful one, please open an issue with your code snippets or a pull request.
API
- class ModifyTypoScriptConfigEvent
-
- Fully qualified name
-
\TYPO3\
CMS\ Frontend\ Event\ Modify Typo Script Config Event
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.