This project is read-only.

Adding an extra field to menu items

Topics: Customizing Orchard, Writing modules, Writing themes
Feb 23, 2011 at 9:32 AM


I've been trying to modify the main navigation so an extra field is present to let the user choose how the menu is rendered, some of them as drop down menus, and one as a larger horizontal menu (in conjunction with the multi-level navigation module).

I've noticed I can add any fields I like to the Shape in the IShapeTableProvider.Discover method. I've also discovered that my theme can override the view for editing the navigation. Here I found out the MenuItems in were fixed classes rather than malleable content items. So, my chances of getting an extra field in the database along with menu items are looking slim unless I edit the core code.

Is there any way to achieve what I'm talking about in a module? I might be missing something obvious, I'm still learning my way around Orchard.



Feb 23, 2011 at 7:29 PM

I'm afraid menu items predate the full content infrastructure. We might reconsider that in the future but in the meantime you'd probably have to maintain your own store for your own extensions. I filed to track this.

Feb 25, 2011 at 12:34 AM

Oops. Should have checked before I spoke. Menu items *are* content items. So you should be able to alter the type definition to add whatever and then use it in templates.