Whether you’re making your own module, an integration or just a special something-something for your company’s SugarCRM instance, there comes a time when you may want to create a nice page to hold some administrative configuration settings. The best place to put these types of things is on the “Admin” area of Sugar.

The $admin_group_header variable is the array that holds the metadata that determines what the layout of the admin page looks like. To add new links to the admin page, all you need to do is alter the array accordingly in a custom Ext file. To test this out, create a file named abc_Module.php in the following directory: /custom/Extension/modules/Administration/Ext/Administration/ If the directory path does not exist, simply create the folders needed.

Copy and paste the code below into the new file and save. Now, go to SugarCRM and run a “Quick Repair and Rebuild”. This will merge the existing admin options with the new admin options we’ve created.

To see exactly what the code is doing, see the comments in the code.

If you installed this on your system as is, you’ll notice the title and description to “Link 2” show up as a language file label name. Because the scope of the page is within the Administration module, you’ll need to add the labels to the Administration module’s language files. You can do this by creating another extension file named en_us.abc_Module.php (using your language prefix of choice) in the /custom/Extension/modules/Administration/Ext/Language folder. The code should look something like the following (Notice the label names match up to the previous code):

Like before, after running a “Quick Repair and Rebuild”, the changes will be applied, and the labels from the new language file will be pulled onto the admin options page.

To dig deeper into how SugarCRM uses the $admin_group_header array to process the admin page you’ll want to start here: /modules/Administration/index.php. Look for a line that contains “foreach ($admin_group_header as $key=>$values)”. This is where the code begins to loop through the array and build the page.

It’s that simple. Is this how you would have solved the problem? If you have any related tips on this same topic, let everyone know in the comments!

Like this post?

We'll send you an email once a month with the latest posts.

Keep up to date on the latest additions

We'll send you an email every month with handpicked add-ons, reviews, tricks and tips. Don't worry, we hate spam as much as you do.