3

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?

  • To clarify, you want the users to be able to link to there accounts? Can't they do this through the user drop-down in the top right corner under "My Account" or, create a Salesforce object link in the Navigational Menu bar that goes to "My Accounts"? – Geo Mar 28 '17 at 18:38
  • yes I can do that, but its not obvious to users so wanted to put a link on main nav bar to view their account there. – SLM3573 Mar 28 '17 at 18:48
  • @SLM3573 - Just went through this. Unfortunately it requires the use of a Lightning component placed on a Community page to navigate to the Account detail page. - salesforce.stackexchange.com/questions/169044/… - completely ridiculous – Eric Apr 15 '17 at 3:23
2

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.

0

Why don't you use HTML or CSS to create a hyperlink that is large and visible to users where they can select their Account home page? Note that having it in the Navigation bar will allow them to open their records within the Community, whereas the link below will take them out of it.

This HTML below will bring them to the organizations account page

<a href="https://myurl.salesforce.com/001/o/" target="_blank">Go to your Acocunt</a>

This is a copy of the URL that is in the Community Profile drop-down https://MYURL.force.com/s/detail/MYACCOUNTID?t=MYUSERID

  • why would I want to take them out of the Community. The whole point to proper web design is based on having a standardised approach to how people use and navigate. If I have a main nav bar and then links on detail pages to also accomplish the same function then its inconsistent design. It seems that using standard templates this isnt achievable so I will revert to just using the Account link on the User section. Thanks for all responses – SLM3573 Mar 29 '17 at 6:34

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.