I woul开发者_开发问答d 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
You can do this without any code:
- Go to Site building -> Menus -> Add menu.
- Create your menu, let's say Admin menu, and save it.
- Go into Site building -> Menus -> Navigation.
- Click the edit link next to the Administer menu item.
- 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:
- Go to Site Building -> Blocks -> Add menu block.
- Under Parent, select Menu: Navigation and Item: --Administer.
- 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.
精彩评论