Liferay六年中持续被评为Gartner水平门户魔力象限领导者。 原因是
« 返回到 Portlets

Control Panel

The Control Panel is a unified way to access all portal administration tools within Liferay. It provides access to:

Each of the above tools are organized in the corresponding categories and will be accessible through a link in the left menu of the Control Panel as shown in the screenshot below:

Accessing the Control Panel #

All registered users have access to the Control Panel through a link in the dock menu in the upper right corner.

Once in the Control Panel the users will only be able to see those tools in the left menu which they have access to. A regular user with no administration rights will only see the option to administer his own account.

Providing access from a custom theme #

If a custom theme has been developed with its own dock navigation it may be necessary to update it to add a link to the Control Panel. The following velocity code can be used as an example for that purpose:

	#if ($show_control_panel)
		<li class="control-panel">
			<a href="$control_panel_url">$control_panel_text</a>

Customizing the Control Panel #

Look and feel #

The Control Panel comes with a default theme but it's possible to configure it to use any custom theme available. To that end a new property has been created in the configuration file:

Available portlets #

Each of the items in the left menu is implemented through an independent portlet. That makes the menu very dynamic since when any of those portlets is disabled it simply disappears from the menu automatically.

Also it's possible to configure the control panel to remove certain portlets (even if they are enabled) and to add custom portlets to it. This is done individually for each portlet through the liferay-portlet.xml file. For each portlet two parameters have to be provided: The category of the control panel where it will appear. There are four allowed values: 'my', 'content', 'portal' and 'server' The weight: this parameter controls the position within the elements of the same category. The higher the weight the lower it'll appear in the menu. This number can have decimals for complete control of the position

Here is an example configuration for the users administration portlet:


In this example the portlet has been added to the category 'portal' and has a weight of 1.0 which by default puts it in the first position.

Note that it's also possible to add to the Control Panel portlets developed either within the ext environment or as plugins by just filling these two properties in their corresponding liferay-portlet.xml files.

Also note that the portlet cannot be instanceable. (ie the property in liferay-portlet.xml must be false:


Permissions #

By default all portlets added to to the Control Panel will only be available only to users with the Administrator role. It is also possible to provide more finegrained permissioning by providing a custom class that determines whether or not a Control Panel portlet should be available depending on the permissions of the user.

That class is registered in the liferay-portlet.xml entry for each portlet. Following with the example of the previous section, for the users administration portlet we add:


The class provided must implement the interface com.liferay.portlet.ControlPanelEntry:

public interface ControlPanelEntry {

   public boolean isVisible(
       PermissionChecker permissionChecker, Portlet portlet) 
      throws Exception;


To ease migration to future versions of Liferay which may add new methods to this interface it's recommended to extend the class BaseControlPanelEntry instead of implementing the interface directly. For example:

   public class UsersControlPanelEntry 
      extends BaseControlPanelEntry {

Related resources #

1 附件
102932 查看
平均 (0 票)
满分为 5,平均得分为 0.0。
讨论主题回复 作者 日期
Thanks for this clear post. One question... Fabrice Clari 2009年1月28日 下午1:36
OK, here is the hack for those who are... Fabrice Clari 2009年1月29日 上午1:08
hi all i have developed a custom portlet in ext... zahid khan 2009年2月17日 下午10:56
here is what i have written in my... zahid khan 2009年2月17日 下午10:57
<portlet>... Andrey Kazantsev 2009年10月1日 上午1:12
When i add this line in... enda enda enda 2009年10月26日 上午3:30
So there's no way other than editing that .xml... Ryan McElwain 2009年2月26日 下午3:13
we can add our custom portlet in control... Kowbathullah Gnaniyar 2009年3月7日 上午2:17
I'm in the same boat as Ryan - we want to give... Andrew Gruhn 2009年3月19日 上午9:09
How can I put chat portlet at the bottom of the... Anand Abhyankar 2009年7月7日 上午3:50
One little notice. If you create your own... Robert Bohonek 2010年2月9日 上午6:47
Hi all, I have to add a customizing... Elisa Ingrà 2010年11月9日 上午9:08
Hi all, I have find a good step by step... Elisa Ingrà 2010年11月18日 上午6:14
How do I create a ControlPanelEntry to check if... Daniele Segato 2011年1月19日 上午8:24

Thanks for this clear post.
One question concerning the customization: it is possible to completely hide the column on the left side. I just want my users to be able to update their profile (addresses, websites, details...).

在 09-1-28 下午1:36 发帖。
OK, here is the hack for those who are interested. Liferay guys, if there is another solution, more "regular", I will appreciated it :-)

1/ Top title and left column must be hidden. Simplest solution is to hide through CSS related containers. But this has to be applied only for the control panel page as in another pages some divs may have same classes.

So in the portal_normal.vm, in the current theme:

#if ($layout.getName().indexOf("Control Panel") > 0)
<style type="text/css">
.panel-page-content-menu {
display: none;

.portlet-borderless-container {
display: none;

2/ the settings table must be expanded to take all the width available. Edit the following file ROOT/portal/layout/view/control_panel.jsp and find the line with contains :

<table class="lfr-ctrl-panel <%= panelCategory %>"> . Update this table with the width attributes:

<table class="lfr-ctrl-panel <%= panelCategory %>" width="100%">. This line is #85 on Liferay sources from trunk version 25618. Setting a table width should be doable from CSS but does not work.

Then, you can leave the control_panel.jsp file at its location (but be careful when updating Liferay) or in a hook with the custom-jsp-dir directive.

If other solution exist, do not hesitate to share them :-)

在 09-1-29 上午1:08 发帖以回复 Fabrice Clari
hi all i have developed a custom portlet in ext env. and trying to bring that in control panel by following the steps mentioned above, but it says that these two attributes are not valid, and ut gives me a list of attributes that i can use in the portlet tag of the liferay-portlet-ext.xml file.

can any one tell whats wrong here or what i have to do to have my custom portlet appaer in the control panel.
在 09-2-17 下午10:56 发帖。
here is what i have written in my liferay-portlet-ext.xml file


在 09-2-17 下午10:57 发帖。
So there's no way other than editing that .xml file to give non-administrators access to the "Portal" portlet in the Control Panel?
在 09-2-26 下午3:13 发帖。
we can add our custom portlet in control panel.

But how can we get the vertical navigation menu like control panel ?

I go through "Root/html/portla/layout/view/control_panel.jsp" this page. But i dont get proper solution.

Is there any other way? pls clarify.
在 09-3-7 上午2:17 发帖以回复 Ryan McElwain
I'm in the same boat as Ryan - we want to give web producers access to items in the "Portal" portlet, but not access to the "Server" portlet. Is there any way to manipulate this access using only role definitions (*and not by having to crack code?)
在 09-3-19 上午9:09 发帖以回复 Ryan McElwain
How can I put chat portlet at the bottom of the control panel?
在 09-7-7 上午3:50 发帖。

The order of elements plays role...
在 09-10-1 上午1:12 发帖以回复 zahid khan
When i add this line in liferay-portlet-ext.xml:
I have an error. I don't know why?
在 09-10-26 上午3:30 发帖以回复 Andrey Kazantsev
One little notice. If you create your own control panel theme and add this line to, where mycustomtheme is ID from liferay-look-and-feel-ext.xml, so dashes are ignored from ID. eg.: <theme id="test-theme" name="Test theme">, so
在 10-2-9 上午6:47 发帖。
Hi all, I have to add a customizing Authentication into the settings menu, Is it possible to do as a new plugin? I mean if I create a new portlet which .xml files, or others, I have to modify and with which code lines in order to add my portlet as a customizing authentication feature? I had a look to the authentication.jsp file (LIFERAY_HOME\tomcat-6.0.26\webapps\ROOT\html\portlet\enterprise_admin\settings)­ and I saw the authentication list (names="general,ldap,cas,facebook,ntlm,open-id,open-sso,siteminder"), so I suppose I have to add here my customizing authentication name, but is it correct? Maybe It's better to make some test, but if somebody has already made this kind of test could let me know something about it?
Many thanks
在 10-11-9 上午9:08 发帖。
Hi all,
I have find a good step by step tutorial­Authentication+System
在 10-11-18 上午6:14 发帖以回复 Elisa Ingrà
How do I create a ControlPanelEntry to check if the user has the permission to see Portlet X into community Y?

Since I only have a PermissionChecker and a Portlet object I see no way of knowing the scope group.

Can this help to work-around the issue described here?­20361%2075

See also comments of this blog post:

在 11-1-19 上午8:24 发帖。