Newer Version Available
NavigationMenu
This type extends the Metadata
metadata type and inherits its fullName field.
File Suffix and Directory Location
NavigationMenu components have the suffix .navigationMenu and are stored in the navigationMenus folder.
Version
NavigationMenu components are available in API version 47.0 and later.
Special Access Rules
The MultipleNavigationMenu permission is required.
Fields
| Field | Field Type | Description |
|---|---|---|
| container | string | The name of the navigation menu container. |
| containerType | string | The container type. The options are Network or CommunityTemplateDefinition. |
| label | string | The navigation menu label as it appears in the Experience Builder UI. |
| NavigationMenuItem[] | A list of menu items in a NavigationMenu. Use this object to create, delete, or update menu items in your site’s navigation menu. |
| Field | Field Type | Description |
|---|---|---|
| defaultListViewId | string | If the value of the type field is SalesforceObject, the value is the ID of the default list view for the object. |
| label | string | Required. The text that appears in the navigation menu for this item. |
| menuItemBranding | NavigationMenuItemBranding | Branding for the navigation menu item. Available in API version 47.0 and later. |
| position | int | Required. The location of the menu item in the navigation menu. |
| publiclyAvailable | boolean | When set to true, gives access to guest users. |
| subMenu | NavigationSubMenu | A list of child menu items. This field is available in API 39.0 and later. |
| target | string | Required if type is ExternalLink, InternalLink, or SalesforceObject. If type is ExternalLink or InternalLink, the target is the URL that the link points to. For ExternalLink, your entry looks like this: http://www.salesforce.com. For InternalLink, use a relative URL, such as /contactsupport. If type is MenuLabel or NavigationalTopic, target isn’t used. |
| targetPreference | string | Backed by a picklist that includes preferences for the target
field. Valid values are:
|
| type | string | Required. The type of navigation menu item. Valid values are:
You can’t nest other items of type MenuLabel or NavigationalTopic under MenuLabel. |
Declarative Metadata Sample Definition
The following is an example of a NavigationMenu component.
1<?xml version="1.0" encoding="UTF-8"?>
2<NavigationMenu xmlns="http://soap.sforce.com/2006/04/metadata">
3 <container>Service</container>
4 <containerType>Network</containerType>
5 <label>Test Navigation</label>
6 <navigationMenuItem>
7 <label>Accounts</label>
8 <position>1</position>
9 <publiclyAvailable>false</publiclyAvailable>
10 <target>Account</target>
11 <type>SalesforceObject</type>
12 </navigationMenuItem>
13 <navigationMenuItem>
14 <label>External Link</label>
15 <menuItemBranding>
16 <tileImage>google_image</tileImage>
17 </menuItemBranding>
18 <position>2</position>
19 <publiclyAvailable>false</publiclyAvailable>
20 <target>http://google.com</target>
21 <targetPreference>OpenExternalLinkInSameTab</targetPreference>
22 <type>ExternalLink</type>
23 </navigationMenuItem>
24 <navigationMenuItem>
25 <label>All Objects</label>
26 <position>3</position>
27 <publiclyAvailable>false</publiclyAvailable>
28 <subMenu>
29 <navigationMenuItem>
30 <label>Leads</label>
31 <position>0</position>
32 <publiclyAvailable>false</publiclyAvailable>
33 <target>Account</target>
34 <type>SalesforceObject</type>
35 </navigationMenuItem>
36 </subMenu>
37 <type>MenuLabel</type>
38 </navigationMenuItem>
39</NavigationMenu>The following is an example package.xml that references the previous definition.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>*</members>
5 <name>NavigationMenu</name>
6 </types>
7 <version>47.0</version>
8</Package>Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.