How to set Active MenuItem SystemName in 4.10

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 лет назад
Hi,

Does any one knows how to set active menu in custom plugin in nopCommerce 4.10? in nopcommerce 3.90 it can be done using this method "SetActiveMenuItemSystemName" but due to use of new plugin layout its not working anymore.

Thanks.
Na.
5 лет назад
Does this post help ?

https://www.nopcommerce.com/boards/t/48503/how-to-access-defined-htmlextensionnopwebframework-in-plugin.aspx
5 лет назад
In Plugin.cs when you are adding SiteMapNode add :SystemName="AnyNameYouWant"
Example:
YourPluginNode.ChildNodes.Add(new SiteMapNode()
                {

                    Title = _localizationService.GetResource("List"),

                    Visible = true,

                    IconClass = "fa-list",

                    Url = Url,
                    SystemName = "AnyNameYouWant"

                });

In View:
//active menu item (system name)
Layout = "_AdminLayout";
    Html.SetActiveMenuItemSystemName("AnyNameYouWant");
3 года назад
You should check in two places:
1. Remove IWidgetPlugin in you plugin
2. In View (Ex: Configure.cshtml) you can change  like this:
@{
    Layout = "_AdminLayout";
    Html.SetActiveMenuItemSystemName("SystemName");
}
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.