Menus

From Request Tracker Wiki
Revision as of 18:43, 12 January 2012 by Alexmv (talk | contribs) (Fix links)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

There are three types of menus in RT4: the main menu, the page menu, and the page widgets.

Modifying Menus

All of these menus can be altered, culled, and augmented by CustomizingWithCallbacks. The main RT menu can be modified from the "Menu" object in the callback. Here is an example of adding a new root menu item to RT:

local/html/Callbacks/*/Elements/Tabs/Privileged

<%init>
# Add a brand new root menu item
my $bps = Menu()->child(
    'bps', # any unique identifier
    title => 'Corporate',
    path  => 'http://bestpractical.com'
);

#Add a submenu item to this root menu item
$bps->child(
    'wiki',
    title => 'Wiki',
    path  => 'http://wiki.bestpractical.com',
);

#Retrieve the 'actions' page menu item
if (my $actions = PageMenu->child('actions')) {
    $actions->child(
        'newitem',
        title => loc('New Action'), path => '/new/thing/here',
    )
}

# Remove the 'home' root menu item (don't try this at home!)
Menu->delete('home');