Add new menu item to shipping

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
HellO!
I trying to add new menu item to shipping area like^

var menuItem = new SiteMapNode()
            {
                SystemName = "Plugin.Shipment.ShipmentRestictions.Menu",
                Title = _localizationService.GetResource("Plugins.Shipment.ShipmentRestictions.RestrictionMenuName"),
                ControllerName = "ShipmentRestictions",
                ActionName = "Configure",
                Visible = true,
                RouteValues = new RouteValueDictionary() { { "area", null } },
            };
            
            var pluginNode = rootNode.ChildNodes.FirstOrDefault(x => x.SystemName == "Shipping");



But pluginNode in null because it cannot find ChildNode with system name Shipping. Could u please tell me how can i do it?
7 years ago
Oke i find solution

var menuItem = new SiteMapNode()
            {
                SystemName = "Plugin.Shipment.ShipmentRestictions.Menu",
                Title = _localizationService.GetResource("Plugins.Shipment.ShipmentRestictions.RestrictionMenuName"),
                ControllerName = "ShipmentRestictions",
                ActionName = "Configure",
                Visible = true,
                RouteValues = new RouteValueDictionary() { { "area", null } },
            };

            var pluginNode = rootNode.ChildNodes.FirstOrDefault(x => x.SystemName == "Configuration").ChildNodes.FirstOrDefault(p => p.SystemName == "Shipping");

            if (pluginNode != null)
            {
                pluginNode.ChildNodes.Add(menuItem);
            }
            else
            {
                rootNode.ChildNodes.Add(menuItem);
            }


But question is why i see it like this? Why its not look likes as a other menus?

link to image http://imgur.com/a/btlTC
7 years ago
Because you are missing the icon:

var menuItem = new SiteMapNode()
            {
                ...
                IconClass = "fa-dot-circle-o",
                ...
            };
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.