Custom Portlet Modes in Liferay 5.2.3

This post will show you how you can integrate the feature of using Custom Portlet Modes in your Liferay 5.2.3 – Portal. I realized this as part of my Bachelor Thesis at University of Applied Sciences Weingarten.

Custom Portlet Modes are not supported by Liferay Portal because this part is optional in the Portlet Standard (JSR-168 and JSR-286). So the Liferay guys just did not implement it.
It took me quite some time to get it done but finally it worked!! My Liferay portal now supports custom portlet modes.

After you modified your Liferay, your portlets will be able to use custom portlet modes according to the portlet standard! This is a pretty cool feature which a lot people are missing.

What you will need:

What you have to do:

1.) download the modified files and copy them into your EXT-Project at the correct positions

2.) modify your ext-spring.xml and add the following lines:
[code lang=”xml”]


3.) modify your and add the following line:

[code lang=”ini”]

With these modifications you will be able to run portlets that are using custom portlet modes.

To test your new functions and to give you an idea of how to use these modes, here is a Test portlet which uses a custom portlet mode. You can download the war file or the sources with the included Eclipse project. Your choice!

If something does not work properly, please let me know. Comments are highly appreciated! 🙂
Maybe this works with Liferay 6 too, but i have not tested it yet. Maybe someone could do this and let me know if it works too!

Have fun!

2 thoughts on “Custom Portlet Modes in Liferay 5.2.3

  1. Ben

    No, this does not work with Liferay 6. Just tried it. Compilation complains of the “detected inclusion of portal-impl.jar in WEB-INF/lib”.


Leave a Reply to Ben Cancel reply

Your email address will not be published. Required fields are marked *