Class MenuAttributeBase
Base class for attributes that builds up the navigation.
Implements
Inherited Members
Namespace: EPiServer.Shell.Navigation
Assembly: EPiServer.Shell.dll
Version: 9.12.2Syntax
public abstract class MenuAttributeBase : Attribute, _Attribute
Constructors
MenuAttributeBase(String)
Initializes a new instance of the MenuAttributeBase class.
Declaration
protected MenuAttributeBase(string menuPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | menuPath | The unique path of the menu item. |
Properties
MenuPath
Unique path for the menu item
Declaration
public string MenuPath { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
/top/forum/search
ResourceType
The strongly typed resource wrapper to use for resource string lookups
Declaration
public Type ResourceType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
Remarks
If not set the Current will be used to find a match for TextResourceKey.
SortIndex
An index for ordering menu items. See SortIndex values for predefined values.
Declaration
public int SortIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Text
Text to display in the menu
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TextResourceKey
Name of a resource key to use for localized menu text
Declaration
public string TextResourceKey { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This can either be a resource key to a resource provided by Current or the name of the static resource wrapper property if ResourceType is set.
Methods
GetLocalizedText(String, String)
Gets the localized text or the fallback text if no localized text is found.
Declaration
public virtual string GetLocalizedText(string resourceKey, string fallbackText)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceKey | The resource key. |
System.String | fallbackText | The fallback text. |
Returns
Type | Description |
---|---|
System.String |
Remarks
This uses the static instance Current
if ResourceType is null
.
GetLocalizedText(String, String, LocalizationService)
Gets the localized text or the fallback text if no localized text is found.
Declaration
public virtual string GetLocalizedText(string resourceKey, string fallbackText, LocalizationService localizationService)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceKey | The resource key. |
System.String | fallbackText | The fallback text. |
LocalizationService | localizationService | The service used for localization. |
Returns
Type | Description |
---|---|
System.String |