How To Add new link in Admin Menu ?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hello..!!

I am using nopCommerce 3.90 souce.
On that, i create one controller and view for test page now i would like to open that particular page directly from Admin Menu.

http://docs.nopcommerce.com/display/en/How+to+add+a+menu+item+into+the+administration+area+from+a+plugin

Above Link i refer but can't get that because on which file can i implement that particular code is not described.

Can anyone Please Help me how to add Link on that and Please Explain in detail.
How to add Link? How to Give Permission for that Link? etc..

Thanking You.
7 years ago
pragnesh-sst wrote:
Hello..!!

I am using nopCommerce 3.90 souce.
On that, i create one controller and view for test page now i would like to open that particular page directly from Admin Menu.

http://docs.nopcommerce.com/display/en/How+to+add+a+menu+item+into+the+administration+area+from+a+plugin

Above Link i refer but can't get that because on which file can i implement that particular code is not described.

Can anyone Please Help me how to add Link on that and Please Explain in detail.
How to add Link? How to Give Permission for that Link? etc..

Thanking You.


Goto==> \Nop.Web\Administration\sitemap.config file

And another way you can add menu in admin from plugin
7 years ago
sohel wrote:

Goto==> \Nop.Web\Administration\sitemap.config file

And another way you can add menu in admin from plugin



Thank You for Replying..

But there is required for PermissionNames. How can i add PermissionNames??
Without PermissionNames it can't be show in SideMenu.
7 years ago
You can also add new permission ==>Go through ==>PermissionService.cs

But I think you can use a existing permission too ..if it is related to you menu ..i.e MangeProducts
6 years ago
Thanks for the reply Sohel,  but I'm also interested in adding a new menu item using a plugin.
How can we achieve this.

As much as I wanted to adhere to Keep It Simple Silly rules a requirement is a requirement :)
6 years ago
/////////////////////
Note If you want to list your plugin in sub set of plugins menu use "Third party plugins" otherwise use another string instead of that in line:
var pluginNode = rootNode.ChildNodes.FirstOrDefault(x => x.SystemName == "Third party plugins");
6 years ago
This is very simple
You can code like below:
In your plugin main class:
add this interface to your class: IAdminMenuPlugin
after that implement this way:


public void ManageSiteMap(SiteMapNode rootNode)
{
    var menuItem = new SiteMapNode()
    {
        SystemName = "YourCustomSystemName",
        Title = "Plugin Title",
        ControllerName = "ControllerName",
        ActionName = "List",
        Visible = true,
        RouteValues = new RouteValueDictionary() { { "area", null } },
    };
    var pluginNode = rootNode.ChildNodes.FirstOrDefault(x => x.SystemName == "Third party plugins");
    if(pluginNode != null)
        pluginNode.ChildNodes.Add(menuItem);
    else
        rootNode.ChildNodes.Add(menuItem);
}




/////////////////////
Note If you want to list your plugin in sub set of plugins menu use "Third party plugins" otherwise use another string instead of that in line:
var pluginNode = rootNode.ChildNodes.FirstOrDefault(x => x.SystemName == "Third party plugins");
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.