Hide Sign In Portlet

Objective of this article:  Hide Sign In Portlet. 

Use : No specific use. Its one of the requirement.

Do you want to Hide Sign In portlet? What does it actually means? Hiding portlet is a common requirement in Portal application. One of the most widely used portlet in Liferay is Sign In Portlet. Its used to log in the portal. After log in this portlet simply displays the name of the user who is logged in. In some requirement the client may ask you to hide the portlet after login. Here is a quick tip to hide Sign In portlet. Before log in it will be visible as usual but after log in it will be invisible.

 

In the below screen the Sign In portlet is shown in red color which is displayed before log in.

sign-in-portlet
Sign In Portlet

Log in  as Admin and go to look and feel as below.

look-and-feel
Change Look & Feel

In the advance styling add below code and save the changes. Below are the two CSS classes which affect the look & feel of Sign In Portlet. This is the only one step to hide the portlet.


.signed-in .portlet-login  {
display: none;
}

advance-styling
Add CSS

Refresh your browser. Sign In Portlet will be invisible.

Careful: 

Suppose you want to revert back. How will you revert back ? Once the above CSS code is saved the portlet will be invisible.Even the configuration icon wont be available. The portlet will be visible only after log out.Again another problem is as Guest user i.e., without log in you can not change any configuration of a portlet.Then what to do?  Inspecting element by firebug is only the rescue. Inspect the page as shown in the below screen.
inspect
Inspect Page to Revert back

The same thing can be done in VM file of the theme also. But by changing the CSS is the most light wight solution to hide the portlet.

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
%d