NavigationMenu

Represents the navigation menu in an Experience Builder site. A navigation menu consists of items that users can click to go to other parts of the site. This type replaces the NavigationLinkSet subtype on Network. NavigationMenu is available in API version 47.0 and later.

The Help Center and LWR templates (Build Your Own and Microsites) don’t include generic record pages. So if you create an object or global action type menu item that links to a Salesforce object, make sure that you also create the corresponding object pages. If you don’t create the associated object pages, end users won’t see anything if they click on the menu item.

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

NavigationMenu components have the suffix .navigationMenu and are stored in the navigationMenus folder.

Version 

Introduced in API version 47.0.

Special Access Rules 

The MultipleNavigationMenu permission is required.

Fields 

container 

  • Type: string
  • Required: Yes
  • Description: The name of the navigation menu container.

containerType 

  • Type: string
  • Required: Yes
  • Description: The container type. The options are Network or CommunityTemplateDefinition.

label 

  • Type: string
  • Required: Yes
  • Description: The navigation menu label as it appears in the Experience Builder UI.

navigationMenuItem 

  • Type: NavigationMenuItem[]
  • Required: No
  • Description: A list of menu items in a NavigationMenu. Use this object to create, delete, or update menu items in your site’s navigation menu.

NavigationMenuItem Type 

Represents a single menu item in the NavigationLinkSet subtype on Network (API version 37.0 to 46.0) or in the NavigationMenu type (API version 47.0 and later). Use this object to create, delete, or update menu items in your site’s navigation menu.

Fields 

defaultListViewId 

  • Type: string
  • Required: No

label 

  • Type: string
  • Required: Yes
  • Description: The label that identifies this component in the Salesforce UI and in metadata listings. Character limits and translation behavior follow the enclosing type.

menuItemBranding 

position 

  • Type: int
  • Required: Yes

publiclyAvailable 

  • Type: boolean
  • Required: No

subMenu 

target 

  • Type: string
  • Required: No

targetPreference 

  • Type: string
  • Required: No

type 

  • Type: string
  • Required: Yes

NavigationMenuItemBranding Type 

Branding for a menu item.

Fields 

tileImage 

  • Type: string
  • Required: No
  • Description: Name of the ContentAsset to use for the navigation menu item.

NavigationSubMenu Type 

A list of child menu items. Only NavigationMenuItem items of type MenuLabel can have items in a NavigationSubMenu. Available in API 39.0 and later.

Fields 

navigationMenuItem 

  • Type: NavigationMenuItem[]
  • Required: No
  • Description: A list of menu items in a NavigationSubMenu. Use navigationMenuItem to create, delete, or update child items under a parent heading.

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.