Recent Bloggers

Ankit Prajapati
Posts: 5
Stars: 0
Date: 9/18/17
Chirag Patel
Posts: 4
Stars: 0
Date: 9/15/17
Rahul Joshi
Posts: 5
Stars: 0
Date: 9/15/17
Jiten Vaghela
Posts: 1
Stars: 0
Date: 8/23/17
Kuldeep Acharya
Posts: 1
Stars: 0
Date: 8/16/17
Saurang Suthar
Posts: 5
Stars: 0
Date: 7/5/17
Jyoti Verma
Posts: 3
Stars: 0
Date: 6/29/17
Pankti Patel
Posts: 1
Stars: 0
Date: 5/27/17
Chandrika Baraiya
Posts: 5
Stars: 0
Date: 5/27/17
Atith Patel
Posts: 5
Stars: 0
Date: 5/23/17
« Back

How to add Custom Catagory in Liferay's Control Panel

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.

<control-panel-entry-category>my_custom_category</control-panel-entry-category>

<control-panel-entry-weight>1</control-panel-entry-weight>

 

  • Specify name of the category in <control-panel-entry-category>.
  • Sequence of portlet in control panel will determined through <control-panel-entry-weight>.
 
That's it. Once you restart your server, you will have your custom category display in Control Panel.
 
For more implementation details or support you may contact us at enquiry@surekhatech.com.
Comments
Trackback URL:

No comments yet. Be the first.

Contact Us

Loading

Get in touch

Headquarter :
302, Landmark,
Nr. Titanium City Center,
Prahlad Nagar Road,
Ahmedabad, India - 380015.