Search Results for

    Show / Hide Table of Contents
    View Source

    Class MenuItem

    A context menu item

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Models.Trees
    Assembly: Umbraco.Core.dll
    Syntax
    [DataContract(Name = "menuItem", Namespace = "")]
    public class MenuItem

    Constructors

    View Source

    MenuItem()

    Declaration
    public MenuItem()
    View Source

    MenuItem(String, String)

    Declaration
    public MenuItem(string alias, string name)
    Parameters
    Type Name Description
    System.String alias
    System.String name
    View Source

    MenuItem(String, ILocalizedTextService)

    Declaration
    public MenuItem(string alias, ILocalizedTextService textService)
    Parameters
    Type Name Description
    System.String alias
    ILocalizedTextService textService
    View Source

    MenuItem(IAction, String)

    Create a menu item based on an IAction definition

    Declaration
    public MenuItem(IAction action, string name = "")
    Parameters
    Type Name Description
    IAction action
    System.String name

    Properties

    View Source

    Action

    Declaration
    [IgnoreDataMember]
    public IAction Action { get; set; }
    Property Value
    Type Description
    IAction
    View Source

    AdditionalData

    A dictionary to support any additional meta data that should be rendered for the node which is useful for custom action commands such as 'create', 'copy', etc...

    Declaration
    [DataMember(Name = "metaData")]
    public Dictionary<string, object> AdditionalData { get; }
    Property Value
    Type Description
    Umbraco.Cms.Core.Dictionary<System.String, System.Object>
    Remarks

    We will also use the meta data collection for dealing with legacy menu items (i.e. for loading custom URLs or executing custom JS).

    View Source

    Alias

    Declaration
    [DataMember(Name = "alias", IsRequired = true)]
    [Required]
    public string Alias { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    Icon

    Icon to use at action menu item.

    Declaration
    [DataMember(Name = "icon")]
    public string Icon { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    Name

    Declaration
    [DataMember(Name = "name", IsRequired = true)]
    [Required]
    public string Name { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    OpensDialog

    Used in the UI to inform the user that the menu item will open a dialog/confirmation

    Declaration
    [DataMember(Name = "opensDialog")]
    public bool OpensDialog { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    SeparatorBefore

    Ensures a menu separator will exist before this menu item

    Declaration
    [DataMember(Name = "separator")]
    public bool SeparatorBefore { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    TextDescription

    Declaration
    [DataMember(Name = "textDescription")]
    public string TextDescription { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    UseLegacyIcon

    Used in the UI to indicate whether icons should be prefixed with "icon-". If not legacy icon full icon name should be specified.

    Declaration
    [DataMember(Name = "useLegacyIcon")]
    public bool UseLegacyIcon { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    View Source

    ExecuteJsMethod(String)

    Adds the required meta data to the menu item so that angular knows to attempt to call the Js method.

    Declaration
    public void ExecuteJsMethod(string jsToExecute)
    Parameters
    Type Name Description
    System.String jsToExecute
    View Source

    LaunchDialogUrl(String, String)

    Sets the menu item to display a dialog based on a URL path in an iframe

    Declaration
    public void LaunchDialogUrl(string url, string dialogTitle)
    Parameters
    Type Name Description
    System.String url
    System.String dialogTitle
    View Source

    LaunchDialogView(String, String)

    Sets the menu item to display a dialog based on an angular view path

    Declaration
    public void LaunchDialogView(string view, string dialogTitle)
    Parameters
    Type Name Description
    System.String view
    System.String dialogTitle
    View Source

    NavigateToRoute(String)

    Sets the menu item to navigate to the specified angular route path

    Declaration
    public void NavigateToRoute(string route)
    Parameters
    Type Name Description
    System.String route
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • MenuItem()
      • MenuItem(String, String)
      • MenuItem(String, ILocalizedTextService)
      • MenuItem(IAction, String)
    • Properties
      • Action
      • AdditionalData
      • Alias
      • Icon
      • Name
      • OpensDialog
      • SeparatorBefore
      • TextDescription
      • UseLegacyIcon
    • Methods
      • ExecuteJsMethod(String)
      • LaunchDialogUrl(String, String)
      • LaunchDialogView(String, String)
      • NavigateToRoute(String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX