Forums de discussion

Remove a portlet programmatic from one page

raghu raghu, modifié il y a 10 années.

Remove a portlet programmatic from one page

New Member Publications: 4 Date d'inscription: 02/11/11 Publications récentes
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, modifié il y a 10 années.

RE: Remove a portlet programmatic from one page

Regular Member Publications: 234 Date d'inscription: 13/03/12 Publications récentes
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, modifié il y a 10 années.

RE: Remove a portlet programmatic from one page

New Member Publications: 4 Date d'inscription: 02/11/11 Publications récentes
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