November Happy Hour will be moved to Thursday December 5th.

How to create a custom menu item?

Vote:
 

Hello all,

I'm trying to display a custom menu item for a custom ASPX page in the CMS. I would like this to appear:

under Community, Moderation Mode

or

under Community, Admin Mode

so that it is available to editors.

So far I'm able to display it under CMS, Admin Mode, which is only available to administrators. This is possible through the GuiPlugin.

I tried (shooting in the dark) these things: implementing a community IModule and return a custom ascx control, a standard IModule returning a custom AdministrationNode, decorating my Page with a EPiServer.Shell.Navigation.MenuItem pointing to my custom page, implementing a custom MenuProvider.

I got no results.

At some point I even got an error message that I should be referencing System.ComponentModel.Composition version 2009... ?

With all these plumbing classes I see in ILSpy (MenuAssembler, MenuProvider and the whole family of them) you would expect that this shouldn't be that difficult. Does anyone know how to make this happen?

 

Thanks!

#55011
Nov 15, 2011 15:16
Vote:
 

Hi

Look at the "Extending the Navigation" section of this document for information on how you would add custom items to the menu.

Regards

Per Gunsarfs
EPiServer Development Team

#55012
Nov 15, 2011 17:30
Vote:
 

Thanks, that's what I needed! I had to register my module in the shell section of the config file and then annotate my page with the MenuItem and MenuSection attributes and that does the trick.

I saw through ILSpy that if use /global/Community/Admin or /global/Community/Moderate as the path, it will end up in the same section.

However I'm thinking maybe create my own top level section, because the community links render in an iframe through EPiServerCommunity/Admin.aspx which then doesn't happen with my page and that creates some UI inconsistency.

Thanks for the help!

#55028
Nov 16, 2011 10:11
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.