I am trying to add a couple of administration menu items. They appear fine in the default menu (the one that normally appears in a sidebar by default), but since I am not using the default Drupal menu (it doesn't fit in with my theme), I am relying on the Administration Menu module (the new menu that floats at the top of the page). For some unfathomable reason (to me), these new menu items will not appear at all in that menu. Does anyone have a clue why? I am fairly new to Drupal (not new to PHP), and cannot figure out why. And at the moment, seems a little daunting for me to go picking through the Drupal code. Figured I'd post here first in the event the answer is common and straightfoward.

I am logged in with the administrator account.

Thanks,
M.

Comments

mheacock’s picture

Moved from Module Development forum. (Just realized it was the wrong place to ask.)

mheacock’s picture

I did a search and found this potential solution:

"All items below 'administer' are displayed in the admin menu. Move it below 'administer' and it will show up."

I moved my new menu below 'administer', at the same level as 'administer' (right above 'log out'), and it still does not show up. I then moved the new menu item tree within the 'administer' tree, between 'Reports' and 'Advanced Help', and it still does not show.

Arg.

M.

mheacock’s picture

One last toss of the hat. Still cannot get admin items to show in the top floating admin menu bar (though they do appear in the default sidebar admin menu.)

jnammour’s picture

I was having trouble with the same issue and found a way to solve it. I am not sure but I wanted to let everyone know just in case you guys are still struggling with it. Basically if you look at the menu items in the admin menu you will notice that all the items in a specific category have a similar path.

admin/content/types
admin/content/node

So, if you include the menu item you are trying to add in the Navigation Menu and make sure that it has the proper path then it will appear in the admin menu. For example, If I wanted to add a menu called "menu-test" I would make sure that the path is admin/content/menu-test and it would appear in the admin menu under the content management tab. That is it. I hope this helps.

warrunner’s picture

I'm having the same problem. Added new menu item to Admin menu and it shows up in the menu list but not in the dropdown. I have moved it around and reset the menus and trashed the cache all to no avail. Anyone?

MarkDQ’s picture

Same behaviour. More, when i change the item labels (such as the shorter "content" instead of "content management"), the old admin menu in navigation reflects the change, the new advanced admin menu does not. It looks like the advanced menu lives his own life...

justageek’s picture

I have only got new items to show by wiping and rebuilding the menu every time I add an item. Another possible solution is to clear any cached data, as menus are cached.

sh264’s picture

i'm running 6.x-3.0-alpha3 (which is awesome btw) and cannot locate the 'wipe rebuild' option in the menu or by trying /admin/build/menu and /admin/settings/admin_menu
am i being total newb and not looking in the right place? also i have tried flushing all caches (via admin menu) and emptying browser cache to no avail.

ozish’s picture

In 6.x-3.0-alpha4 (and presumably 6.x-3.0-alpha3) there is no 'wipe and rebuild' option. Instead use the first menu in the admin menu toolbar (little icon in top left corner of bar), select Flush all caches, then Administration menu. This will rebuild the admin menu. Hope this saves someone some time, as this question never seems to get answered in any of the threads in which it is asked!

FreddieK’s picture

Subscribing...

xsean’s picture

subscribing

slicksw20’s picture

I'm encoutering the same issue - even after flushing cache and rebuilding the menu, my item doesn't appear. Has anyone discovered a solution to this?

FreddieK’s picture

I've switched to using the Simplemenu module which is more or like the same but doesn't suffer from the same issue. If i have administration menu enabled it's mostly for the convenient way to flush cache while developing.

guigui_nyc’s picture

By looking at the code,

in admin_menu.inc it says line 32:
If you want to alter links saved by admin_menu, use hook_menu_link_alter() and look for $item['module'] == 'admin_menu'

I don't believe we can change anything from the menu administration because the module is always reading a menu named 'admin_menu' from the `menu_links` table.
This menu doesn't exist and can't even be created since it has a special character.
The navigation menu is completely disconnected from the admin_menu and that's confusing: I believe the navigation menu gets updated automatically by new installed module and is only used on the admin block. However, the admin menu builds and rebuilds its menu tree dynamically from the code.

The only item I was able to add was a view: in the view settings, if you assign the view to the navigation menu, then it will show up in the admin menu header. But there is no way you can manage sub-items...

The question is do you want to add php code just for the purposing of adding menu items..

Itangalo’s picture

The term "menu" in Drupal has unfortunately two different meanings. One is visible menus, such as Navigation and Primary links – which can be displayed in blocks. One has to do with associating different paths with the functions to display the relevant pages. I'm no expert in Administration Menu, but it appears to be based on exclusively the second definition.

Thus, to make a menu item show in Administration Menu, it must have a path starting with "admin/". This is not possible with, say, nodes and user pages but is possible in (for example) Views where you can set your own path for page displays.

That Aministration Menu doesn't care about the first meaning of menus is confirmed if you turn off the core module Menu – Administration Menu will still work and display everthing mapped under admin/.

I hope this may shed some light on the isuue.

sebagr’s picture

Well, I have my new item under /admin but it's still not showing up... so it's not as easy as making its path start with /admin...

subscribing...

Jerimee’s picture

subscribing

Peter Majmesku’s picture

You can create a new submenu item in a mini-module, like this:

function additional_admin_menu_links_admin_menu_output_alter(&$content) {

  // the new item
  $content["menu"]['0']['399'] = array(
    '#title' => t('Test'),
    '#href' => 'test-url',
    '#weight' => 10,
  );

}
ricmel111’s picture

subscribing

kbellcpa’s picture

Maybe you guys can help me. I don't know how to put this, but it seems that my navigation site outline (not block, but outline with cross hair handles you can move up and down is gone, but I now have an administration site outline that looks exactly like my old navigation menu. I had to reinstall my administration menu because it seemed to be corrupted and now under site building/menus I have 4 items when I used to have 3. My 4 are:

Adminstration menu
Navigation
Primary Links
Secondary Links

I can go to the Administration menu and add a new menu, and it shows up in my adminstration menu with the cross hairs and in my menus on top. This seems like what you are trying to do.

I don't know how this happened, but I want my navigation menu outline back and I want the administration menu outline to go away. I still have my navigation block on the right side, but I can't enable or disable any of my items without the outline, but I can enable and disable as well as add and delete items in the administration outline and they will appear in the top dropdown menu. I can also add items to my navigation menu and they appear in the block, however my outline says, "There are no menu items yet." How did these two menus switch?

cromac’s picture

Set up the rest of the item as you like but the type must be set to MENU_NORMAL_ITEM to appear, or so it seems!

This goes into hook_menu when declaring your admin pages, no other changes were required.

$items['admin/settings/MYMODULE'] = array(
      'type' => MENU_NORMAL_ITEM,
    );

also make sure you are clearing your caches

superxain’s picture

Subscribing...

MyriamB’s picture

Refering to this thread http://drupal.org/node/276751#comment-4018194
#75 comment solution worked for me. I was trying with only the path setting with my view, but then I added a "normal menu entry" inside my views settings, under navigation menu, and I finally got it in the so practical Admin Menu. Hope it'll help for someone else too.

drupalnesia’s picture

This bug has fixed on 6.x-3.0-alpha4.
NOTE: you must clear Drupal cache after add/edit any item to Administer Menu (there is new menu named as "Administration Menu", on previous version this menu part of Navigation menu).

mromero51’s picture

good afternoon, I explain my case: I have trouble visualizing a management of menu options, previously saw but now appears which seems weird. the truth that worries me because I can not create my newsletters and even in the upper left part of the run cron I appeared which also appears without that I can not send my notifications and then every time after I have sent a bulletin to run cron so you can get to all staff.
  if I could help or any comments. the intranet is in drupal 6

thank you very much

pwiniacki’s picture

Same problem here - I can't add menu item to administration menu...

EDIT: with path: [admin]

Drupal beginer

keansmith’s picture

I've struggled with this issue over the years. There is a comment above mentioning that path is important. That is absolutely correct. There is something about the admin/management menu which relies upon path, unlike the other menus. If, for example, you are adding a search feature for users, the path must start "admin/people". I've found that's the only way to consistently create new admin menu items and have them appear. Good luck.

Drupalima’s picture

Please follow the below steps to add menu in admin panel

Go to Administration -> Structure -> Menus
Click on 'Add links' in 'Management' menu row
Add 'Menu link title' and 'Path' for menu item.
Set 'Parent link' for the menu item, so it would display in correct position.
Save the form

John Pitcairn’s picture

If you are trying to add a top-level menu item manually via admin/structure/menu, and that item has no children, you may need to check "expanded" to have the item show up in the admin menu bar.