I have primary links created manually. The are links to node (content type 'page') like
-About --About Us --About company
I need to add subitems About/About company/company1
and About/About company/company2
from my module.
Next lines create menu item in first level (in one level with -About
)
$items['about2'] = array(
'menu_name' => 'primary-links',
'title' => 'About2',
'page callback' => 'ninegm_about2',
'access callback' => TRUE,
'weight' => -10,
);
Check out the documentation at the Drupal API site. The path of the menu item, and the hierarchical organization, is determined by the key you pass to $items when defining a new menu item. Right now you are making a completely new top-level menu item.
So you need to replace
$items['about2'] with something like this:
This will make the new menu item a child of the menu items in its path, so it will come out looking like this:
-About
--About Company
---About2
This is assuming the path to your root about page is "About", and the path to your About Company page is "About company". If that isn't true, just replace them with the real paths to those pages.