How to add menu item in existing top menu using plugin 4.4.4
Hi,
I want to add one menu item in our existing top menu in custom plugin .
Please help
public void ManageSiteMap(SiteMapNode rootNode)
{
var pluginNode = rootNode.ChildNodes.FirstOrDefault(x => x.SystemName == "Third party plugins");
if (pluginNode != null)
{
var parentNode = new SiteMapNode() // this one is showing only
{
//SystemName = "Widgets.PromoSlider",
Title = "Promo Slider",
ControllerName = "PromoSlider",
ActionName = "CreateUpdatePromoSlider",
Visible = true,
RouteValues = new RouteValueDictionary() { { "area", "admin" } }
};
parentNode.ChildNodes.Add(new SiteMapNode()
{
Title = _localizationService.GetResource("Admin.Configuration.Settings"),
// Title for your Sub Menu item
ControllerName = "Widget", // Your controller Name
ActionName = "ConfigureWidget", // Action Name
Visible = true,
RouteValues = new RouteValueDictionary() { { "systemName", this.PluginDescriptor.SystemName } },
});
parentNode.ChildNodes.Add(new SiteMapNode()
{
SystemName = "Widgets.PromoSlider",
Title = "Manage Sliders",
ControllerName = "PromoSlider",
ActionName = "ManagePromoSliders",
Visible = true,
RouteValues = new RouteValueDictionary() { { "Namespaces", "Nop.Plugin.Widgets.PromoSlider.Controllers" }, { "area", null } }
});
pluginNode.ChildNodes.Add(parentNode);
}
}