0

I am creating a custom plugin for Nopcommerce 4.1 for learning purposes. I copied the default plugin PickupInStore and changed it to my needs. I then added a custom item in the sidebar that redirects to the configuration page of my plugin and it works, but when I click it, it doesnt highlight the new item but an item in configuration>shipping>Pickup points. So my question is how do I highligh the added item when it's clicked insted of something else.

How my plugin in the sidebar looks: https://i.stack.imgur.com/la3T8.png

What it opens: https://i.stack.imgur.com/YKpWQ.png

I add my plugin to the sidebar with this method in my plugin class

public void ManageSiteMap(SiteMapNode rootNode)
        {
            var menuItem = new SiteMapNode()
            {
                SystemName = "My first plugin",
                Title = "MyPlugin",
                ControllerName = @"Admin/MyPlugin",
                ActionName = "Configure",
                Visible = true,
                RouteValues = new RouteValueDictionary() { { "area", null } },
                IconClass = "fa fa-magic"
            };
            var pluginNode = rootNode.ChildNodes.FirstOrDefault(x => x.SystemName == menuItem.SystemName);
            if (pluginNode == null)
                rootNode.ChildNodes.Add(menuItem);
            //else
            //    rootNode.ChildNodes.Add(menuItem);
        }
MilkSake
  • 43
  • 5

1 Answers1

0

Add the bellow code

   @{
        //page title
        ViewBag.Title = "MyPlugin";
        //active menu item (system name)
        Html.SetActiveMenuItemSystemName("My first plugin");
    }

To the respective Razor page.

sina_Islam
  • 1,068
  • 12
  • 19