Following media lib implementation, First level of Admin Sub Menu has disappeared

Topics: Core, Customizing Orchard, Troubleshooting, Writing modules
Apr 21, 2013 at 9:40 AM
Edited Apr 21, 2013 at 9:41 AM
This code was previously displaying an Admin SubMenu named Currencies.
Now it has disappeared, I get the admin page directly clicking on the parent Menu.
    public class CurrenciesAdminMenu : INavigationProvider {
        public string MenuName {
            get { return "admin"; }
        }

        public CurrenciesAdminMenu() {
            T = NullLocalizer.Instance;
        }

        private Localizer T { get; set; }

        public void GetNavigation(NavigationBuilder builder) {
            builder
                .AddImageSet("datwendo-commerce")
                .Add(item => item
                    .Caption(T("Datwendo Commerce"))
                    .Position("3")
                    .LinkToFirstChild(true)

                    .Add(subItem => subItem
                        .Caption(T("Currencies"))
                        .Position("3.1")
                        .Action("Index", "CurrenciesAdmin", new { area = "Datwendo.Commerce" })
                    )
                );
        }
    }
}
Is it normal or a new bug ? I see no change on my side, not workingon core navigation components of Orchard ?
Apr 21, 2013 at 9:50 AM
Apr 24, 2013 at 10:38 AM
Edited Apr 24, 2013 at 11:13 AM
Digging further, it appears that the change is in Menu.cshtml of TheAdmin\Views

The change drives to not displaying the first item of a 1st level menu.


I don't understand why? Its breaking all the visual Menu of some sites



<ul class="menuItems">
@{ var first = true;}
            @foreach (var secondLevelMenuItem in secondLevelMenuItems.Where(menuItem => !menuItem.LocalNav)) {
                if (first && firstLevelMenuItem.LinkToFirstChild) {
                    first = false;
                    continue;
                }
previously it was
<ul class="menuItems">
            @foreach (var secondLevelMenuItem in secondLevelMenuItems.Where(menuItem => !menuItem.LocalNav)) {
                string secondLevelTextHint = secondLevelMenuItem.Text.TextHint;
                var firstOfTheThird = ((IEnumerable<dynamic>)secondLevelMenuItem.Items).FirstOrDefault();

I finally found that the update came with the new media lybrary rev 6913
Coordinator
Apr 25, 2013 at 3:06 AM
Please add that to the bug or open a new one.