Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Sections in navigation menu #8860


User avatar
0
darutter0508 created

Metronic has a way of creating a section header in the menu. Is there a way to create those section headers in the standard NavigationProvider MenuDefinition structure?


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

    Hi,

    It is not supported by default. However, MenuItemDefinition class has a property named CustomData, see https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Application/Navigation/MenuItemDefinition.cs#L71. You can use this field to set a Section name. Then, you can group MenuItems in the related cshtml file and show this data when rendering the Menu.

  • User Avatar
    0
    darutter0508 created

    I've searched the forum and this discussion board and haven't found any examples of how to use the CustomData property. Do you have any such examples?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It is very simple, you just need to set this field when defining a MenuItem;

    new MenuItemDefinition(
                            AppAreaNamePageNames.Host.Dashboard,
                            L("Dashboard"),
                            url: "AppAreaName/HostDashboard",
                            icon: "flaticon-line-graph",
                            permissionDependency: new SimplePermissionDependency(AppPermissions.Pages_Administration_Host_Dashboard),
                            order: 1
                        ){
                            CustomData = "Test..."
                        }