Creating a custom menu item inadvertently removes Create and View menu items

I have created a file:

custom/Extension/modules/myModule/Ext/Menus/menu.ext.php

with the contents:


<?php 

global $module_menu;

$module_menu[]=Array(
	"index.php?module=myModule&action=hello" ,
	"Hello","myModule");
?>

I perform a Quick Repair & Rebuild then log out and back in.

My menu item shows up, but the default “Create” and “View” module menu items are missing now.

Using SuiteCRM 7.5.3 on LAMP.

Ideas as to why these default menu items are missing?

You have overwritten the entire menu instead of adding to it.

Here is an example, I added the bottom two menu items.



global $current_user;
global $mod_strings, $app_strings;
$module_menu = array();

// Each index of module_menu must be an array of:
// the link url, display text for the link, and the icon name.


// Create Project
if(ACLController::checkAccess('Project', 'edit', true)) {
    $module_menu[] = array(
        'index.php?module=Project&action=EditView&return_module=Project&return_action=DetailView',
        isset($mod_strings['LNK_NEW_PROJECT']) ? $mod_strings['LNK_NEW_PROJECT'] : '',
        'CreateProject'
    );
}


// Project List
if(ACLController::checkAccess('Project', 'list', true)) {
    $module_menu[] = array(
        'index.php?module=Project&action=index',
        isset($mod_strings['LNK_PROJECT_LIST']) ? $mod_strings['LNK_PROJECT_LIST'] : '',
        'Project'
    );
}

// Project List
if(ACLController::checkAccess('Project', 'list', true)) {
    $module_menu[] = array(
        'index.php?module=Project&action=ResourceList',
        isset($mod_strings['LBL_RESOURCE_CHART']) ? $mod_strings['LBL_RESOURCE_CHART'] : '',
        'Project'
    );
}

// Project Tasks
if(ACLController::checkAccess('ProjectTask', 'list', true)) {
    $module_menu[] = array(
        'index.php?module=ProjectTask&action=index',
        isset($mod_strings['LNK_PROJECT_TASK_LIST']) ? $mod_strings['LNK_PROJECT_TASK_LIST'] : '',
        'ProjectTask'
    );
}

How to create dropdown sub menu on Top menu, not in sidebar. Thanks

My solution.
I add css in custom/themes/css/bootstrap/dropdown.scss

.dropdown-submenu {
    position: relative;
}
.dropdown-submenu > ul.dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
    -webkit-border-radius: 0 6px 6px 6px;
    -moz-border-radius: 0 6px 6px;
    border-radius: 0 6px 6px 6px;
}
ul.dropdown-menu > li.dropdown-submenu > ul {
    display: none;
}
ul.dropdown-menu > li.dropdown-submenu:hover > ul {
    display: block;
}
.dropdown-submenu>a:after {
    display: block;
    content: " ";
    float: right;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 5px 0 5px 5px;
    border-left-color: #ccc;
    margin-top: 5px;
    margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
    border-left-color: #fff;
}

And custom/themes/SuiteP/tpls/_headerModuleList.tpl

{if $module==Accounts}
          <li class="dropdown-submenu"><a href="#">{$module}</a>
                      <ul class="dropdown-menu open">
                                 <li><a href="#">Level 2</a></li>
                                  <li><a href="#">Level 3</a></li>
                       </ul>
          </li>
 {else if}
          <li>

But sub menu wrong display when hover

Screenshot from 2021-07-15 11-34-39

Any idea? please help me

Thanks