function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jonathan SpinkJonathan Spink 

<apex:outputlink> not working in Community

My <apex:outputlink> works fine in Lightning/Classic, but not in my Community ('volunteermanagement'). I have:

<apex:outputLink value="/{!account.id}" target="_top">{!account.name}</apex:outputLink>

but in the community it redirects to:

ttps://mydomain.force.com/volunteermanagement/s/volunteermanagement/AccountHierarchyPage?id=0011p00001cTA2eXXY

It seems to be overcompensating for the community name. What I want is simply:

https://mydomain.force.com/volunteermanagement/s/detail/0011p00001cTA2eXXY

Anyone come across this or have any ideas?

 
ShivankurShivankur (Salesforce Developers) 
Hi Jonathan,

Please try using something like below to check if it works for you:
<apex:outputLink value="{!URLFOR('/s/detail/' + account.Id)}" > 
   <apex:outputText value={!account.name}/>
</apex:outputLink>

Hope above information helps. Please mark as Best Answer so that it can help others in future.

Thanks.
Jonathan SpinkJonathan Spink
Thanks Shivankur. I'm still getting the wrong URL though.