[SalesForce] Napili Navigation Menu

I currently have a Community setup using Napili and more or less functioning as desired. I have one small issue though that I cant seem to find a solution for.

I have the users Account link on the navigation menu and I would like it to go straight to the Account detail page for that account. Currently I am going via list page but this makes no sense as user will be only linked to one account.

I have tried using different syntax but to no avail.

Is there a way to accomplish this?

Best Answer

I see you mentioned 'navigation menu'- there's a solution but it involves a ridiculous amount of code and effort to achieve what you're looking to do.

You'll need to create a Custom Theme Layout- note that the style classes provided on the following example don't inherit the standard styles. You may have some luck attempting to extract the standard markup and using it instead of the markup they've given:

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_config_for_builder_theme_layout.htm

Next- instead of using {!v.navBar}- you'll want to substitute that with a custom navigation menu:

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_forceCommunity_navigationMenuBase.htm

You're free to define additional elements anywhere inside this custom navigation menu (hint: should probably go inside the <ul> and outside the <aura:iteration> tag)- so you'll just need to write a function that retrieves the current user's account ID and mash that into a link that navigates to the Account detail page.