Hiding login section

  • 27 November 2019
  • 1 reply
  • 106 views

Hi I was wondering how I can hide the login section, on the customer portal when a user has logged in.

For example if I log in to the customer portal I am taken to the home page, but if I press the page back button I can see the login box, but I am already logged in.

Is there a way to hide this div container depending on whether the user is logged in.

 


login_45156.png

This topic has been closed for comments

1 reply

Hi Ewan,


If you have the applicable plan to edit your HTML, we have this in our banner to show "Edit Profile" and "Logout" when user is signed in.

 

					<nav class="banner-nav mobileLogin">
<!--{{ portal | welcome_navigation }}-->
{% if portal.has_user_signed_in == true %}

<a href="{{ portal.profile_url }}">Edit Profile</a>
<a href="{{ portal.logout_url }}">Log Out</a>
{% else %}

<a href="https://www.desouttertools.com"> Desoutter Home</a>
{% endif %}

</nav>

 

For your case you could do something like 

 

                            {% if portal.has_user_signed_in == true %}
<div>
<h1>You've already logged in silly!</h1>
</div>
{% else %}
<div>
Your login form goes here
</div>
{% endif %}

 Good luck, hope it helps!