Wednesday, February 23, 2011

Creating and Applying Different Liferay themes to Pages

Here is an example of how to apply different themes on pages in Liferay. Here we have created two themes-

1. First of all in the liferay-look-and-feel.xml file, create two different theme entries that refer to the same theme but have a different value for the header-type setting:


Both the theme entries refer to same theme but they different value for their header-type setting. We can access the settings programmatically in our theme template and then take action based on the settings we have defined.

When this theme is deployed to Liferay, it will display to the user as two different themes.

2. Accessing the settings in portal_normal.vm template file




In the above code we accessed the settings defined in the liferay-look-and-feel.xml file and based on the value of the setting we are parsing different template files.

No comments:

Post a Comment