Hi, I have an application build with AspnetCore + JQuery.
I want to hide a menu item if a tenant has a certain feature activated. In other words, I want to show one menu item if the feature is activated, but show another menu item if the feature is not activated.
In AppNavigationProvicer.cs I can add Menuitems with "featureDependency". If the feature is activated, the menu item is shown, otherwise not. But I want also the opposite. Is that possible?
2 Answer(s)
-
0
Hi,
I think the easiest way is to create your custom https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Application/Navigation/UserNavigationManager.cs, and in
GetMenuAsync
, you can use a similar method as defaultUserNavigationManager
. Then, you can filter result ofFillUserMenuItems
to filter some of the menu items.Instead of extending
UserMenuItem
, you can define a different list which containsUserMenuItem
andFeature
pairs to hide some of the menu items. -
0
Hi, thank you, I will try it that way.