留言板

Remove a portlet programmatic from one page

raghu raghu,修改在10 年前。

Remove a portlet programmatic from one page

New Member 帖子: 4 加入日期: 11-11-2 最近的帖子
Hi All,

I have two page let home and welcome with portlet A in common.

I would like to remove portlet A from home page .it should automatically remove from the portlet from welcome page.

Could you please suggest some approach to solve this issue.


Anticipating an early response.


Thanks in Advance.
Raghu
thumbnail
Subhash Pavuskar,修改在10 年前。

RE: Remove a portlet programmatic from one page

Regular Member 帖子: 234 加入日期: 12-3-13 最近的帖子
Hi,

Below Snippet is the sample code to remove portlet problematically !! Hope it may help you !!

<%@ include file="/html/common/init.jsp" %>
<portlet:defineobjects />
&lt;%
   Portlet portlet = (Portlet)request.getAttribute(WebKeys.RENDER_PORTLET);
   PortletPreferences portletSetup = PortletPreferencesFactoryUtil.getLayoutPortletSetup(layout, portletDisplay.getId());
%&gt;

<c:if test="<%= portletDisplay.isShowCloseIcon() %>">
<span class="portlet-close">
  [color=#FF0000]<a href="<%= portletDisplay.getURLClose() %>"><liferay-ui:message key="close" /></a>[/color]
</span>
</c:if>
raghu raghu,修改在10 年前。

RE: Remove a portlet programmatic from one page

New Member 帖子: 4 加入日期: 11-11-2 最近的帖子
Subhash Pavuskar:
Hi,

Below Snippet is the sample code to remove portlet problematically !! Hope it may help you !!

&lt;%@ include file="/html/common/init.jsp" %&gt;
<portlet:defineobjects />
&lt;%
   Portlet portlet = (Portlet)request.getAttribute(WebKeys.RENDER_PORTLET);
   PortletPreferences portletSetup = PortletPreferencesFactoryUtil.getLayoutPortletSetup(layout, portletDisplay.getId());
%&gt;

<c:if test="<%= portletDisplay.isShowCloseIcon() %>">
<span class="portlet-close">
  [color=#FF0000]<a href="<%= portletDisplay.getURLClose() %>"><liferay-ui:message key="close" /></a>[/color]
</span>
</c:if>




Thanks for your response.

But my question is different.Please have a look and suggest.
Any suggestion is highly appreciable.
Thanks