This project is read-only.

Removing items from admin menu

Topics: Administration, Customizing Orchard, General, Writing modules
May 17, 2011 at 9:25 PM

If I wanted to change the behavior of what items are displayed in the admin menu, what would be the best way to go about it?  For example, say I didn't want to display the "New" menu group (just as an example).  I see a few options:

  1. Via css in a custom admin theme
  2. Create a custom filter that modifies the workContext.Layout.Navigation shape that was created by the default Orchard.UI.Navigation.MenuFilter  (this seems pretty dirty)
  3. Create a new implementation of INavigationManager that replaces Orchard.UI.Navigation.NavigationManager

Any thoughts?  This is not a permissions issue, it's a cosmetic one.  I.E. I want users to be able to create new content, but I'm going to give them more finely tuned menu options via my own modules. 

On a side note, I know it's possible to create a custom admin theme, but are there any instructions as to how one would go about it?

May 17, 2011 at 9:56 PM

The easy way would be to use OrchardSuppressDependency (in your feature) to suppress Orchard.Core.Contents.AdminMenu; then re-add the Content menu which is the only other thing it does.

Not sure about the admin theme but I guess there's a setting somewhere?

May 25, 2011 at 10:45 PM
  1. Pete is right - the best way would be to implement custom INavigationProvider, decorate it with [OrchardSuppressDependency("Orchard.Core.Contents.AdminMenu")] attribute and copy only the part reponsible for building "Content" menu from AdminMenu class (if you don't want to lose it too).
  2. Implementing INavigationManager is an overkill, believe me. You'd do that in case you need a totally different menu-building behavior.
  3. AFAIK there is currently no feature to add new admin themes via GUI. But you can go and tweak the TheAdmin theme found under /Themes/TheAdmin. This is the one used for Dashboard.
May 26, 2011 at 12:47 AM

See also for TheAdmin subtheming