Removing portlet embedded in Liferay Layouts -
know specification says other, there way remove portlet embedded in layout? have layout search portlet on each page, on each page except one.
tried topic: how delete portlet in liferay 6.1 programmatically code, using
<a onclick="liferay.portlet.close('#p_p_id_3_'); return false;">remove</a>
, worked, portlet deleted unnecessary rendered , sent client.
tried code:
themedisplay themedisplay = (themedisplay) req.getattribute(com.liferay.portal.kernel.util.webkeys.theme_display); layout layout = themedisplay.getlayout(); layouttypeportlet layouttypeportlet = (layouttypeportlet) layout.getlayouttype(); list<portlet> portlets = layouttypeportlet.getallportlets(); (portlet portlet : portlets) { if(portlet.getportletid().equalsignorecase(portlettodeleteid)){ layouttypeportlet.removeportletid(userid, portlettodeleteid); layoutlocalserviceutil.updatelayout(layout); } }
but can't list portlets embedded in layout; iterates through portlets add manually portal.
add portlet in layout way:
$processor.processportlet("3")
work in liferay portal 6.2 ga4.
tia
yes, of course there's way: use different layout on page - preferably 1 doesn't embed search portlet.
also page specific css (containing display:none;
search portlet) work. yes, portlet rendered , sent - kind of performance impact speaking about? make any measurable difference? if does: choose option 1 above. if doesn't: don't bother.
Comments
Post a Comment