[SalesForce] Specify the Navigation Menu when extending the forceCommunity:navigationMenuBase component

I'm using a custom component that extends forceCommunity:navigationMenuBase (see this Trailhead for an example of what I'm doing, documentation on the component).

Is it possible to have a design attribute on this component that lets you select the Navigation Menu that you want to use with it? Or are you limited to the Default Navigation Navigation Menu and any additional menus are off limits when it comes to custom navigation?

Edit: For clarity, what I want to do is change the set of Navigation Menu Items being used with my custom component, similarly to how the out of the box community navigation allows you to select the set of menu options you want.

OOTB Navigation Menu design options

My component is already pulling the Default Navigation menu, but I want to know if it's possible to use a different one.

Best Answer

I have answered with a solution to a similar question with the same goal here: https://salesforce.stackexchange.com/a/289509/77440

In summary, there is an undocumented attribute called navigationLinkSetId where you can specify either the Id or developer name of the Navigation Link Set you have created through Community Builder (Settings > Navigation). Adding this attribute with a default value of the Id/developer name of the desired navigation menu will render the corresponding navigation menu items instead of the Default Navigation.

Find the Id or developer name of your navigation menu using SOQL:

SELECT Id, DeveloperName, MasterLabel FROM NavigationLinkSet

Add the attribute to your component that extends forceCommunity:navigationMenuBase:

<aura:attribute name="navigationLinkSetId" type="String" default="My_Custom_Navigation" />

Please find the details of the full solution in the linked answer.