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 anni tempo fa
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 anni tempo fa
Does this post help ?

https://www.nopcommerce.com/boards/t/48503/how-to-access-defined-htmlextensionnopwebframework-in-plugin.aspx
5 anni tempo fa
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 anni tempo fa
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.