2

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.

3

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.

| improve this answer | |
  • 1
    Thanks for this! While I realize this is an undocumented feature within Salesforce, this is a great find and it's got my menu working as I want it. – nbrown Jan 2 at 22:44
1

If you would like to hide the default navigation menu, then you can do so from Settings > Theme.

Click on the gear icon near the them layout component name, then enable option "Hide the header region and navigation", see screenshot below.

You can then drag/drop your custom navigation component on the page to use the custom one.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.