Posted: June 29, 2019 at 8:14 AM Quote #240932
This is just my recommendation to you when you develop a plugin.
I realized when I installed couple of plugins from Marketplace that they create a menu link in Admin as stand alone item. There is already System link group with SystemName == "Third party plugins" where should all plugins go under. Those plugins I installed create a new plugin node and added it to rootNode:


If everybody would do that the menu on the left side of Admin became endless. Here is a sample how to do it so your plugin will appear where it should go - under group Plugins:

       public void ManageSiteMap(SiteMapNode rootNode)
            var pluginMenuName = _localizationService.GetResource("Plugins.[YOUR PLUGIN NAME].Admin.Menu.Title", _workContext.WorkingLanguage.Id, defaultValue: "[YOUR PLUGIN NAME]");
            var settingsSubMenuName = _localizationService.GetResource("Plugins.[YOUR PLUGIN NAME].Admin.Menu.Settings.SubTitle", _workContext.WorkingLanguage.Id, defaultValue: "[YOUR PLUGIN NAME]");
            const string adminUrlPart = "Admin/";
             var pluginNode = rootNode.ChildNodes.FirstOrDefault(x => x.SystemName == "Third party plugins");

            pluginNode.ChildNodes.Add(new SiteMapNode
                Title = settingsSubMenuName,
                Url = _webHelper.GetStoreLocation() + adminUrlPart + "[YOUR PLUGIN NAME]/Configure",
                Visible = true,
                SystemName = "[YOUR PLUGIN NAME]-Settings-Menu",
                IconClass = "fa-nogender"

I hope this helps.
This post/answer is useful
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)