掲示板

Allowing portlet to disappear

8年前 に Jacob Hall によって更新されました。

Allowing portlet to disappear

New Member 投稿: 8 参加年月日: 15/06/23 最新の投稿
Is there a way to make a portlet completely disappear? Im trying to make a portlet that displays content but if theres no content I don't want the portlet to be visible. Is there any suggestions on how I could do this or if its even possible to do this?
thumbnail
8年前 に David H Nebinger によって更新されました。

RE: Allowing portlet to disappear

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Disable portlet borders and that should do it.
thumbnail
8年前 に Olaf Kock によって更新されました。

RE: Allowing portlet to disappear

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Jacob Hall:
Is there a way to make a portlet completely disappear?


Go with David's answer. Some more reason: I've seen one portlet that was completely hidden if it had nothing to show. This is a maintenance nightmare: A page administrator can't even remove it from the page. Thus, if you disable the portlet borders, at least the page administrator will have their little transparent overlays/controls to configure/remove the portlet if needed.

With this, you just don't output any content and make Liferay output no border - done.
8年前 に Jacob Hall によって更新されました。

RE: Allowing portlet to disappear

New Member 投稿: 8 参加年月日: 15/06/23 最新の投稿
How do you recommend disabling the boarders on a per porlet basis?
thumbnail
8年前 に Olaf Kock によって更新されました。

RE: Allowing portlet to disappear

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
That's (apart from globally disabling them or clicking "Look&Feel" and selecting "false") a bit harder.

You could use the API to batch-change all of your portlet's look&feel properties (Can't tell you the approach off my head - that'd require some research). Another option is to try out the use-default-template configuration in liferay-portlet.xml. I admit never to have tried this though.

If we're lucky, the simple solutions from my first line help already...
8年前 に Jacob Hall によって更新されました。

RE: Allowing portlet to disappear

New Member 投稿: 8 参加年月日: 15/06/23 最新の投稿
What about if you want to turn the boarders off based if the portlet has content or not? Is there an easy way to go about it?
thumbnail
8年前 に Amos Fong によって更新されました。

RE: Allowing portlet to disappear

Liferay Legend 投稿: 2047 参加年月日: 08/10/07 最新の投稿
The requests portlet "hides" itself if content is empty which sounds like what you are attempting to do. It sets this attribute if there's no requests:

renderRequest.setAttribute(WebKeys.PORTLET_DECORATE, Boolean.FALSE);
thumbnail
8年前 に Olaf Kock によって更新されました。

RE: Allowing portlet to disappear

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Amos Fong:
renderRequest.setAttribute(WebKeys.PORTLET_DECORATE, Boolean.FALSE);


<add to="toolbox">Neat! Thanks</add>
thumbnail
8年前 に David H Nebinger によって更新されました。

RE: Allowing portlet to disappear

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Jacob Hall:
How do you recommend disabling the boarders on a per porlet basis?


On a per portlet basis? Just go to gear menu, look and feel, and set the "show borders" dropdown to no.