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
EIE50EIE50 

Login/ logout links

Hi,

 

I want to have a dynamic login / logout links in my header part, for example, if a guest user comes to the site/ portal, a login link should be visible, if a user login then a logout link should be visible instead of login, and vice-versa. How can this be done in the salesforce and any starting points for proceeding.

 

Thanks.

CloudDevCloudDev
Assuming you're sharing the same Visualforce page between your unauthenticated Site and an authenticated portal, a simple approach would be to add some conditional logic in the controller (or controller extension) to test the profile of the user. If this equates to guest then it's sites and display Login and so on.. Ideally you want to be use a page template design or a component for this, so the code exists in one place only..