Best eCommerce Hosting Tips - Adding a Menu Item into Administration Area in nopCommerce from a Plugin

Leave a Comment
If you’re a nopCommerce developer, you’ll end up using nopCommerce plugins in your Best nopCommerce Hosting to add your custom features into the nopCommerce to support your online store. Whereas nopCommerce IAdminMenuPlugin doesn’t enable to feature your custom menu things beneath its default menu items, you'll still add your custom menu items into Plugins menu.

Administration menu is build from the Sitemap.Configuration file that is found in Nop.Admin folder. To add your custom menu items in nopCommerce administration panel, you'll add it by extending SitemapNode class of nopCommerce.

To do constant, you'll use following sample code that you wish to add in your plugins’ cs file, once your plugin’s Install and Uninstall technique.

Best eCommerce Hosting Tips - Nopcommerce

public bool Authenticate()
{
return true;
}
public SiteMapNode BuildMenuItem() // SiteMapNode is Class in Nop.Web.Framework.Menu
{
var menuItemBuilder = new SiteMapNode()
{
Title = "Title For Menu item", // Title for your Custom Menu Item
Url = "Path of action link", // Path of the action link
Visible = true,
RouteValues = new RouteValueDictionary() { {"Area", "Admin"} }
};
var SubMenuItem = new SiteMapNode() // add child Custom menu
{
Title = "Title For Menu Chile menu item", // Title for your Sub Menu item
ControllerName = "Your Controller Name", // Your controller Name
ActionName = "Configure", // Action Name
Visible = true,
RouteValues = new RouteValueDictionary() { {"Area", "Admin"} },
};
menuItemBuilder.ChildNodes.Add(SubMenuItem);
return menuItemBuilder;
}

In the on top of code, you'll notice comments wherever you wish to switch values betting on your needs. Moreover, the above code additionally explains however you'll add a child menu items within main menu.
Best eCommerce Hosting Tips - Adding a Menu Item into Administration Area in nopCommerce from a Plugin

Best and Cheap nopCommerce Hosting Recommendation

After finishing the guidelines mentioned above, if you continue to have a ecommerce web host in your mind, then it ought to be worth trying. Or if you currently feel confused and want some suggestion, then you'll read our previous article regarding nopCommerce hosting recommendation.
Next PostNewer Post Previous PostOlder Post Home

0 comments:

Post a comment