Hide Home Page Image Fragment After Sign in for Role User

Jamie Sammons, modified 2 Years ago. New Member Posts: 18 Join Date: 4/11/23 Recent Posts

Hi All,

I would like hide the Image Fragment showing in the Liferay Home page after user is signed in to the portal.

Power User should be able to see the Fragment, Only need to hide for users having role User.

I know we can hide the fragment for different views (Desktop, Mobile, ...) from the page layout edit option.

How we can hide the fragment from home page after user is Signed in to the portal?

I am using Liferay Portal 7.4.3 version

thumbnail
Eric D, modified 2 Years ago. Junior Member Posts: 59 Join Date: 3/25/16 Recent Posts

Hi,

You have differents solutions.

First, you can redirect after login in a another page (landing page).

After, you can do like the login portlet, the portlet can generate nothing for a known user.

In the past, we do that in freemarker with an ADT or the template of a content.

Now with a fragment, you can create your own fragment and generate the content only for the guests.

The best would be to create a container fragment with a drop zone that would generate content only for the guests. (you can use freemarker in fragment with the alternative square braquet syntax)

Eric.