This project is read-only.


Admin menu: LinkToFirstChild(true) ignored on second level menu items


If a menu is built with second-level menu items, where the second level menu item doesn't have an action, but has child LocalNav items, and has LinkToFirstChild set to true, the expected behaviour would be that the menu item would link to the first LocalNav tab (as it would if it were a first level menu item). Instead, it links to the root of the application.

This is because menu.cshtml in the Admin theme accounts for LinkToFirstChild for first level menu items but not second level menu items.


DavidCornish wrote Sep 24, 2012 at 5:03 PM

Demo code to replicate this problem:
            .Add(menu => menu
                .Caption(T("Demo Menu Issue"))
                .Add(submenu => submenu
                    .Caption(T("My Demo"))
                    .Add(tab => tab
                        .Caption(T("Tab One"))
                        .Action("Index", "TestAdmin", new { area = "Orchard.AdminMenuIssue" })
                    .Add(tab => tab
                        .Caption(T("Tab Two"))
                        .Action("", "TestAdmin", new { area = "Orchard.AdminMenuIssue" })
            , new[] { "collapsed" });

sebastienros wrote Sep 29, 2012 at 2:04 AM

Fixed in changeset db57b007549d