Class MenuAssembler
Class used to assemble the site center menu
Inheritance
Inherited Members
Namespace: EPiServer.Shell.Navigation
Assembly: EPiServer.Shell.dll
Version: 8.11.0Syntax
[ServiceConfiguration(Lifecycle = ServiceInstanceScope.Singleton)]
public class MenuAssembler
Constructors
MenuAssembler(IMenuProvider[], IServiceLocator)
Initializes a new instance of the MenuAssembler class.
Declaration
public MenuAssembler(IMenuProvider[] menuProviders, IServiceLocator container)
Parameters
Type | Name | Description |
---|---|---|
IMenuProvider[] | menuProviders | Available menu providers. |
IServiceLocator | container | Used to get the request context. |
Properties
MenuProviders
The menu providers for the assembler.
Declaration
public ICollection<IMenuProvider> MenuProviders { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<IMenuProvider> |
Methods
GetMenuHierarchy(String, Int32)
Creates a menu hierarchy and returns the nodes from below the given path uptil the supplied depth
Declaration
public virtual IList<MenuNode> GetMenuHierarchy(string rootPath, int relativeDepth)
Parameters
Type | Name | Description |
---|---|---|
System.String | rootPath | Menu root path, e.g "/top". |
System.Int32 | relativeDepth | Menu depth, relative to the rootPath |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<MenuNode> | a List of top MenuNodes and theirs children. |
GetMenuHierarchy(String, Int32, String)
Creates a menu hierarchy and returns the nodes from below the given path uptil the supplied depth
Declaration
public virtual IList<MenuNode> GetMenuHierarchy(string rootPath, int relativeDepth, string selectionPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | rootPath | Menu root path, e.g "/top". |
System.Int32 | relativeDepth | Depth of the nodes to include in the result, relative to the rootPath depth |
System.String | selectionPath | The menu path to select, If null the selection will be autoresolved |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<MenuNode> | a List of top MenuNodes and theirs children. |
GetMenuItems(String, Int32)
Gets all menu items below a certain path uptil the given depth
Declaration
public virtual IEnumerable<MenuItem> GetMenuItems(string parentPath, int relativeDepth)
Parameters
Type | Name | Description |
---|---|---|
System.String | parentPath | The path. |
System.Int32 | relativeDepth | The max depth. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<MenuItem> |