Liferay comes equipped out-of-the-box with a variety of portlets that users may add to their page. For various reasons, however, an administrator may wish to remove some of these portlets from the pool of available portlets.
Fortunately, this can be achieved either in the control panel or by editing an .xml file within Liferay.
Resolution
Method 1: Control Panel
- Open Control Panel.
- Go to Configuration.
- Set the desired portlet to be inactive
Method 2: Editing the XML
- Navigate to
{$LIFERAY_HOME}\tomcat-7.0.25\webapps\ROOT\WEB-INFand locateliferay-portlet.xml. This file contains the information necessary to disable the portlets. - Create a
liferay-portlet-ext.xmlfile in this folder. Avoid editting theliferay-portlet.xmlfile directly. Any settings in theliferay-portlet-ext.xmlwill take precedence over theliferay-portlet.xmlfile. - Edit the
liferay-portlet-ext.xmlwith the information below:
<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 5.1.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_5_1_0.dtd">
<liferay-portlet-app>
<portlet>
<portlet-name>1</portlet-name>
<struts-path>mail</struts-path>
<include>false</include>
</portlet>
</liferay-portlet-app>
where "1" is the value corresponding to the portlet number, and "mail" corresponds to the portlet name. These corresponding values are found in the liferay-portlet.xml file. You can verify the portlet name via the portlet IDs found here, http://www.liferay.com/community/wiki/-/wiki/Main/Portlet+IDs
For example, if you want to disable the Documents and Media portlet, you would place the following in the liferay-portal-ext.xml
<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 5.1.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_5_1_0.dtd">
<liferay-portlet-app>
<portlet>
<portlet-name>20</portlet-name>
<struts-path>document_library</struts-path>
<include>false</include>
</portlet>
</liferay-portlet-app>