• Hide Sign In Portlet

    Posted on August 30, 2014 by Hamidul Islam in Liferay.

    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.

    Post Tagged with
Comments are closed.
Top
%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close