How Can I define a new MenuDefinition in addition to MainMenu? I want to create a separate menu in sidebar
In my NavigationProvider i create it by this code
context.Manager.Menus.Add("SideBarMenu",
new MenuDefinition(
"SideBarMenu",
new LocalizableString("SideBaeMenu", EPEDCConsts.LocalizationSourceName))
);
but i can't use it and add MenuItems!
3 Answer(s)
-
0
In C#, inject IUserNavigationManagerand use GetMenuAsync("SideBarMenu", ...). Second parameter can be current user id or null (see <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Application/Navigation/IUserNavigationManager.cs">https://github.com/aspnetboilerplate/as ... Manager.cs</a>).
In javascript, you can get it using abp.nav.menus.SideBarMenu
-
0
Thank you, but how can I add items to my "SideBarMenu" ?
-
0
You should simple add items to the MenuDefinition object before passing it to context.Manager.Menus.Add method. Nothing special here.
Thanks.