SugarCRM: Add a Sub Menu to a Module in Main Menu

This is how you add a new option under a module in the Main Menu on top of the screen.

Lets say you want to add an option “Process Leads” under the Leads module.  To do this:

1. Create a new file in custom/Extension/modules/Leads/Ext/Menus. If the Menus folder doesn’t exist, just make one. We can name the file menu.php.

2. On menu.php file, input codes below:

<?php
global $module_menu;

// This will add the new option
$module_menu[]=Array("index.php?module=Leads&action=ProcessLeads", "Process Leads", "");
?>

In the example above, we assume that the action ProcessLeads is an existing file under custom/modules/Leads with the name ProcessLeads.php but you can also map actions with files.

3.  Just run Repair and Rebuild then logout to see the changes.

About these ads

3 thoughts on “SugarCRM: Add a Sub Menu to a Module in Main Menu

      • John,

        I am looking to add the sub-menu items (like you did above) AND the main navigation menu for a custom package I have created which has 7 modules. I want the main menu and sub-menus added via the manifest file, not via the user manually setting them via the “Configure Module Menu Filters” in the Admin panel.

        I am on SugarCRM CE v 6.5.16

        I could go in and use pre_install scripts to edit the tabConfiog.php file in /custom/include (or, if it does not already exist in the custom directory, then copy it from /include and then edit it in the custom directory), but I am hoping that I can do it by incrementally adding the new items only via an additional file – like you did above for the sub-menus.

        The package was built with Module Builder so all required links are in place for the sub-menus; I just need to figure out how to incrementally add to tabCongig.php without actually editing the file.

        Is this possible and if so, can you show me the way?

        Thanks in advance

        Ramblin.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s