How to add Custom Catagory in Liferay's Control Panel
July 21, 2013
In Liferay's Control Panel, we can see predefined categories such as Portal, Server, Marketplace etc.
Liferay provides functionality where one can also create his own custom category and add it in a Liferay's Control Panel. For this we need to first create an ext-plugin and also need to do some changes in liferay-portlet.xml of portlet which you want to add in custom category.
To do so, you need to follow below mentioned steps:
Create ext-plugin and override PortletCategoryKeys class of it. But make sure your path should be like docroot\WEB_INFext-impl\src\com\liferay\portal\util\PortletCategoryKeys.java.
After that add following code in a class.
For Liferay 6.x
public class PortletCategoryKeys {
public static final String[] ALL = {PortletCategoryKeys.MY,
PortletCategoryKeys.CONTENT, PortletCategoryKeys.PORTAL,
PortletCategoryKeys.SERVER,
PortletCategoryKeys.MY_CUSTOM_CATEGORY };
public static final String CONTENT = "content";
public static final String MARKETPLACE = "marketplace";
public static final String MY = "my";
public static final String PORTAL = "portal";
public static final String SERVER = "server";
public static final String MY_CUSTOM_CATEGORY = "my_custom_category";
}
For Liferay 6.1.x
public class PortletCategoryKeys {
public static final String[] ALL = { PortletCategoryKeys.MARKETPLACE,
PortletCategoryKeys.MY,
PortletCategoryKeys.CONTENT, PortletCategoryKeys.PORTAL,
PortletCategoryKeys.SERVER,
PortletCategoryKeys.MY_CUSTOM_CATEGORY };
public static final String CONTENT = "content";
public static final String MARKETPLACE = "marketplace";
public static final String MY = "my";
public static final String PORTAL = "portal";
public static final String SERVER = "server";
public static final String MY_CUSTOM_CATEGORY = "my_custom_category";
}
Add Language-ext.properties file in a folder named content under “docroot\WEB_INFext-impl\src\’’ folder & add following line in it,
category.my_custom_category=Surekha Technologies (this would be category name)
To add your portlet in that category add following code in liferay-portlet.xml in between <portlet> tag.
We use cookies to deliver personalized content, analyze trends, administer the site, track user movements on the site, and collect demographic information about our user base as a whole. Accept all cookies for the best possible experience on our website or manage your preferences.
What For?