Tuesday, April 20, 2010

Customise language in Liferay Portal.

This documentation done based on Liferay 5.2.3, tomcat-6.0.18.

In our portal, we need to use two languages. Malay as Primary and English secondary language.
To localise the language, we configured in portal-ext.properties.
The properties for language is set as shown below.

#limit the language selection.

Since Malaysia flag icon not available, we need to add the 16 x 11 icon image in

It means that when we use language portlet, only two flags will appear in the porlet. We also can put the flag icon in portal theme.
Just use $theme.language() to be wrote in our template [by writing it in portal_normal.vm].


Monday, April 12, 2010

Email Notification for Announcements portlet.

Configure users setting.
Go to Control Panel > Users

Edit users with assigning them Guest community, and Announcement.

Configure Server Administration (Control Panel > Server Administration)

For outgoing port, use port 2525

Then add this properties in portal-ext.properties

Problem statement and Solution

The current email_body.tmpl is very simple.

Sometimes, we need to modify it so that the message becomes formal (Official).

How to modify email_body.tmpl in Announcements portlet?

In liferay Enterprise Edition (Liferay EE), email_body.tmpl located in folder dependencies.
Path: ~/html/portlet/announcements/WEB-INF/classes/com/liferay/portlet/announcements/dependencies

For those who use liferay Community Edition (Liferay CE), this file can be found in liferay-portal-src-5.2.3
Path: liferay-portal-src-5.2.3/portal-impl/src/com/liferay/portlet/announcements/dependencies

Then we need to do ant deploy in ext-impl. Copy email_body.tmpl and paste in ~/ext/ext-impl/src/com/liferay/portlet/announcements/dependencies
Notes that we need to create folders announcements and dependencies if they not existed.

Go to ~/ext/ext-impl
Then run command: ant deploy

Testing an announcement.

1. Add annoucement portlet in admin page (or any page).
2. Write your announcement.