Section Nav Group Menu

You can create navigation menus (Context Menu's) for each Section Nav Group. We use them extensively through the CMS for things like Create Content or Create Content Type etc...

To create a Menu Item, you need to inherit from ISectionNavGroupAction

public interface ISectionNavGroupAction
{
    string Text { get; }
    string Icon { get; }
    string IconColor { get; }
    string SectionNavGroupAlias { get; }
    int SortOrder { get; }
    Task ContextMenuAction(MenuItemEventArgs e, NavigationManager navigationManager, ContextMenuService contextMenuService, IModalService modalService);
}

Example Video

This video below shows how quick it is to create a menu item

Example Code

This is the code we use to create a folder menu item for compositions

public class CreateCompositionFolder : ISectionNavGroupAction
{
    public string Text => "Create Folder";
    public string Icon => "folder";
    public string IconColor => string.Empty;
    public string SectionNavGroupAlias => Constants.Sections.SectionNavGroups.StructureCompositionsNavGroup;
    public int SortOrder => -50;

    public Task ContextMenuAction(MenuItemEventArgs e, NavigationManager navigationManager, ContextMenuService contextMenuService,
        IModalService modalService)
    {
        contextMenuService.Close();
        navigationManager.NavigateTo($"{Urls.AdminStructureCreateFolder}/2", true);
        return Task.CompletedTask;
    }
}

Last updated