Monday, December 29, 2014

Add Portlet(Custom portlet) to Control Panel

Today we learn how to move a Custom portlet from Application menu to Control panel.

Step 1:- Create a simple Hello World Portlet 

 Create a simple Hello World Portlet and provide display Category as HelloWorld so this portlet is  available in Category HelloWorld.


<?xml version="1.0"?>
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.2.0//EN" "">

<category name="HelloWorld">
<portlet id="hello-world"></portlet>

So this portlet is shown as:-

Step 2:- Search For DTD

Go to the URL mention in liferay-portlet.xml  ( and

a)search for tag  <control-panel-entry-category>

Set the control-panel-entry-category value to "my" to make this portlet
available within the My Account administration of the user. Set the value to
"apps", "configuration", "sites", or "users" to make it available in the Control
Panel under that category. Set the value to "site_administration.configuration",
"site_administration.content", "site_administration.pages" or
"site_administration.users" to make it available in the Site Administration
under that category. Legacy values from previous versions of Liferay will be
automatically mapped to the new values: "content" to
"site_administration.content", "portal" to "users", and "server" to "apps".

by using this you can decide in which category you want to display your portlet.

b)search for tag  <control-panel-entry-weight>

Set the control-panel-entry-weight value to a double number to control the
position of the entry within its Control Panel category. Higher values mean
that the entry will appear lower in the Control Panel menu.


So we use a) and b) in liferay-portlet.xml as


Deploy it and this portlet shown in sites .

But there is a problem this portlet shown in Control panel as well as in Applicaton so we have to remove it from Application.

Step 3:-Hiding portlet from Application

Find the file liferay-display.xml in server
and search the tag <category name="category.hidden"> use this category in your  liferay-display.xml

<category name="category.hidden">
<portlet id="hello-world"></portlet>

Note:-If you use any other Category like or then this portlet goes to that particlar category.

And thats it Your Portlet is now available in Control panel and not in Application.

In the next blog we learn how to move a Out of box portlet from Application menu to Control panel.

Hope this Help...

Related Post:-

1 comment:

Total Pageviews

Number Of Unique Visitor

Free counters!