Tag Archives: liferay

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 portal-ext.properties 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!

How you integrate a new jQuery version into Liferay Portal

Here I will show you how you can integrate the lates jQuery version into your Liferay Portal (version 5.2.3 but should also work with 6.x). I will do this with jQuery version 1.3.2 (I know, that’s not the latest atm) but it will work straight forward with any other version.

What you will need:

  • the jQuery version you want to add to your liferay (here i will use ‘jquery1.3.2.js’)
  • the plugins you want to use with your new jQuery version (here ‘ui.jquery1.7.js’ and ‘ui.stars.js’)
  • your Liferay-EXT Environment
  • One file from the Liferay Source Code (top_head.jsp)

Ok, let’s start:

– Copy the file “top_head.jsp” located in folder “liferay-portal-src-[version]\portal-web\docroot\html\common\themes\” into the EXT-folder ‘liferay[version]-portal-ext\ext-web\docroot\html\common\themes\’

– Open the copied file in your EXT

– Go to line 125, just above this: <%– Portal JavaScript References –%>

Add the following lines:
[code lang=”javascript”]

– Now you can access jQuery 1.3.2 through the variable ‘jQuery132‘.

– Have fun with the new version! 🙂

This does not affect the original jQuery variable in your Liferay Portal!
And you can have as many jQuery versions in your Liferay portal as you want!
Just add them this way and give the variables different names.

Hey Folkz!

Hey Folkz!

This ist my first post on my new blog!

In a few days or weeks I will post here how you can integrate custom portlet modes into your Liferay Portal!
I got it working! 🙂 I did this with Liferay 5.2.3 but I will have a look at the latest Liferay 6.x version if it works there too.