Base solution for your next web application
Open Closed

IsVisible property of MenuItemDefinition is not working on top level menu item #8718


User avatar
0
j.chow created

i want to use IsVisible to show/hide menu item. but expect top level menu item Abp zero: core mvc 7.3.1


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    This issue is fixed in 8.4 release. You can check the related issue and its solution here

  • User Avatar
    0
    j.chow created

    Thanks for your solution.

    I have added following code into default.cshtml and top.cshtml

        @for (var i = 0; i < Model.Menu.Items.Count; i++)
        {
            var menuItem = Model.Menu.Items[i];
           *** if (!menuItem.IsVisible)
            {
                continue;
            }***
            @await Html.PartialAsync("Components/AppMenu/_UserMenuItem", new UserMenuItemViewModel
            {
                MenuItem = menuItem,
                MenuItemIndex = i,
                RootLevel = true,
                CurrentPageName = Model.CurrentPageName
            })
        }