Base solution for your next web application
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?

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

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.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • 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?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • 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..."
                        }
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)