MenuItemLink.cshtml in theme only affects last menu item?

Topics: Customizing Orchard, General, Troubleshooting, Writing themes
Sep 6, 2012 at 8:39 PM
Edited Sep 6, 2012 at 8:43 PM

Subject says it all...

I'm trying the customize the default menu by putting a custom MenuItemLink.cshtml view into the views folder of my custom theme.

However, only the last menu item seems to be affected by this.

If I do the same with the MenuItem.cshtml view, all menu items are effected.

Why is MenuItemLink.cshtml not working as I expected? I'm using 1.5.1.

Tried to debug but as a noob the sourcecode is really overwhelming...

Sep 7, 2012 at 9:24 PM

Got a little closer to the problem myself...

Seems like I need to name the view "MenuItemLink-ContentMenuItem.cshtml" instead of "MenuItemLink.cshtml". Then it's working for all but the last menu item; that one still needs "MenuItemLink.cshtml".

Why? Well, the last menu item is a custom form... Which is not a Content Menu Item.

Is there a way to unify both views so I can stay DRY? Or do I need to copy/paste the markup to both views?


Sep 7, 2012 at 10:15 PM
Edited Sep 7, 2012 at 10:15 PM

Looks like a bug. Please report it here: