Adding menu element
This section contains general information regarding adding the new menu elements
Sidebar menu
Sidebar menu templates can be found in: templates/page-elements/components/sidebar
.
Start with creating new menu node in: templates/page-elements/components/sidebar/menu-nodes/
important
For better structure organization, keep the menu nodes the same as the added module or functionality.
Now take a look on this example as there are few elements that do matter here due to the automated logic:
data-menu-node-name
and classsidebar-menu-node-element
- it's not required but this is prepared to reload single menu node and works so far just for few modules{{ keepMenuOpen(currUrl, '', 'my-notes') }}
- is used to keep the nested menu constantly open
tip
Constants such as MENU_NODE_MODULE_NAME_NOTES
are defined in src/Action/System/AppAction.php
,
Twig vars are defined in templates/page-elements/components/sidebar/menu.twig
Now add the new menu node in templates/page-elements/components/sidebar/menu.twig
Top menu
Top menu logic is defined in templates/page-elements/components/sidebar/menu.twig
, and the components
are equivalents of the menu nodes
in sidebar.
There is no special logic regarding top menu.