Custom Exponent Menu
It may be desirable to create a custom menu within the Exponent system menu to allow quick access to commands in your module (or any action within Exponent CMS).
- The .php file will exist within the theme subfolder, 'modules/administration/menus' folder.
- The filename will determine where in the system menu, the custom menu will appear (alphabetical sort).
- The existing system menus begin with the letters 'a' thru 'f'
- The 'Pages' system menu filename begins with the letter 'y' to place it next to last, though the last left justified menu
- The user account system menu filename begins with the letter 'z' to place it as the last menu and right justified.
- The file is auto-loaded with the rest of the system menu arrays and creates an additional mult-dimentional array of the menu and submenu items.
- The array for the main menu items consists of:
- 'text' to display in the menu
- 'classname' is a classname for for a traditional system icon for non-bootstrap icons
- 'icon' is a bs3/fa4 classname for the item
- 'icon5' is a bs4/fa5 bs5/fa6 classname for the item
- 'iconbs' is the bs5/boostrapicon classname for the item
- 'id' is an optional id to allow for javascript or css identification
- NOTE: you may not need to include all the classname, icon, icon5, and iconbs entries since only the framework for your theme will be used.
- The sub-arry for menu items adds an item in addition to the above
- 'url' the url of the menu item
<?php if (!defined('EXPONENT')) exit(''); global $user; // needed to access user record if (!($user->isAdmin())) { // for this particular menu, only admin accounts allowed to view/access return false; } ///////////////////////////////////////////////////////////////////////// // BUILD THE MENU ///////////////////////////////////////////////////////////////////////// $items = array( array( 'text' => gt('Manage Help Versions'), 'icon' => 'fa-list-ol', 'classname' => 'manage', 'url' => makeLink( array( 'controller' => 'help', 'action' => 'manage_versions' ) ), 'id' => 'versions-manage', ), array( 'text' => gt('Manage Help Docs'), 'icon' => 'fa-file', 'classname' => 'manage', 'url' => makeLink( array( 'controller' => 'help', 'action' => 'manage', 'version' => 'current' ) ), 'id' => 'manage_help', ), ); return array( 'text' => gt('Help Docs'), 'icon' => 'fa-info-circle', 'classname' => 'helpdocs', 'submenu' => array( 'id' => 'helpdocs', 'itemdata' => $items, ) ); ?>
Loading Help