The getUserNavigation hook allows to manipulate the back end user navigation.
It passes the back end modules and a flag wether to show collapsed navigation
items. Expects the array of modules as return value.
Parameters
array$modules
The compiled list of back end modules.
boolean$showAll
Wether to show all modules even if the group is collapsed.
Return Values
Add your custom modules to the list and return the array of back end modules.
Example
// src/EventListener/GetUserNavigationListener.php
namespaceApp\EventListener;useContao\CoreBundle\DependencyInjection\Attribute\AsHook;#[AsHook('getUserNavigation')]
classGetUserNavigationListener{publicfunction__invoke(array$modules,bool$showAll):array{// Add custom navigation item to the Contao website
$modules['system']['modules']['contao']=['label'=>'Contao homepage','title'=>'Visit the Contao CMS website','class'=>'navigation contao','href'=>'https://contao.org/en/',];return$modules;}}