Fórum

hiding web content display portlet

thumbnail
Narmada V, modificado 11 Anos atrás.

hiding web content display portlet

Junior Member Postagens: 37 Data de Entrada: 14/05/12 Postagens Recentes
Hi all,

I have created a web content display portlet on one page and added content to it. I have imported this content on to another liferay page using the Page Type as Web content.

Now, in the liferay, i am able to see both the web content portlet and page in liferay with the same data. Is there any way dat i can hide the portlet for all the liferay users irrespective of the roles??

I can do this by making the page hidden on which i have the web content display portlet. But i want to know is there any alternative to hide the portlets instead of hiding the page.

Can anyone please help me on this??
Hiral Ramavat, modificado 11 Anos atrás.

RE: hiding web content display portlet

Regular Member Postagens: 103 Data de Entrada: 13/02/12 Postagens Recentes
Hi,

Below are the ways to hide the web content portlet.

1. Set the the web content permission (Go to the configuration -> permission tab), remove view permission from all the users. So, when any user hit that page, the message will be display like "You do not have the roles required to access this portlet."

2. You can hide that page, so no user can access that page.

3. With CSS : Go to the portlet look and feel -> Advance styling, Get the portlet instance ID from that

Now navigate to : Manage pages -> Select that page -> look and feel tab -> CSS tab.
Put the below css in to the text area.

#portlet_56_INSTANCE_0XjU {
display:none;
}
Note : #portlet_56_INSTANCE_0XjU - This will be your portlet instance id.

Hope it will help you.

Thanks,
Hiral
thumbnail
Narmada V, modificado 11 Anos atrás.

RE: hiding web content display portlet

Junior Member Postagens: 37 Data de Entrada: 14/05/12 Postagens Recentes
Hi Hiral,

even though removing the view permissions for the portlet, i am able to see the portlet on the page.

But the CSS option is working fine.

Thank you.
Kavita Gupta, modificado 11 Anos atrás.

RE: hiding web content display portlet

Junior Member Postagens: 64 Data de Entrada: 12/03/08 Postagens Recentes
Hi,

You can also use PORTLET_VISIBILITY option for making the portlet invisible to others.

Regards,
Kavita
thumbnail
Narmada V, modificado 11 Anos atrás.

RE: hiding web content display portlet

Junior Member Postagens: 37 Data de Entrada: 14/05/12 Postagens Recentes
Hi Kavita,

May i know how can this be used ?
Kavita Gupta, modificado 11 Anos atrás.

RE: hiding web content display portlet

Junior Member Postagens: 64 Data de Entrada: 12/03/08 Postagens Recentes
Hi,

I have written below code in java for hidding the portlet

request.setAttribute(WebKeys.PORTLET_DECORATE, Boolean.FALSE);
request.setAttribute(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY, Boolean.FALSE);


Let me know if you need more info.

Regards,
Kavita
thumbnail
Narmada V, modificado 11 Anos atrás.

RE: hiding web content display portlet

Junior Member Postagens: 37 Data de Entrada: 14/05/12 Postagens Recentes
Hi Kavita,

I don't want it to be hided from java class. Thanks for the reply.
Kavita Gupta, modificado 11 Anos atrás.

RE: hiding web content display portlet

Junior Member Postagens: 64 Data de Entrada: 12/03/08 Postagens Recentes
You can do the same thing from the JSP also.