views:

19

answers:

1

Hello guys

I would like to separate administrator menus (the menus that appear after login as admin) from normal menus. I have to show admin menus in some other blocks. I don't like to use any modules for this, let me know how can done this with code,

Thank you

+1  A: 

You can do this without any code:

  1. Go to Site building -> Menus -> Add menu.
  2. Create your menu, let's say Admin menu, and save it.
  3. Go into Site building -> Menus -> Navigation.
  4. Click the edit link next to the Administer menu item.
  5. Change the Parent to your new menu and save.

Your new menu will now contain the entire Administer menu tree, and it'll be out of the original Navigation menu. From there, you can move each part of the menu around to your liking.

This way is not without issues, though: there are still modules that depend on the Administration menu being in a specific place, and this messes with that.

I encourage you to re-think your aversion to modules: it's really against the spirit of Drupal. Almost everything under the sun has been already created as a Drupal module, and you're encouraged to reap the benefits of the open-source community.

For example, to avoid the pitfalls of the approach I outlined, there are two modules that can really help: the first one is Administration menu: enable it and that's it. The administer menu will disappear from the Navigation menu, and you'll have a new admin menu that'll appear on every page for easy access.

The second one is Menu block, which lets you create sub-menu blocks. If you have it enabled, you can:

  1. Go to Site Building -> Blocks -> Add menu block.
  2. Under Parent, select Menu: Navigation and Item: --Administer.
  3. Save the block. You now have a block available that contains just the administration menu.

You'll now have the administration menu in a separate block to do with as you please.

Mark Trapp
Thank you very much
john