Liferay – Simple Theme Development

Indeed, Liferay has come a long way with its 6.1 version, that fully supports JSF and IceFaces. I’m still trying to learn the ropes of it as I aim to have it the standard collaboration tool in our team.

Good Software Application solve problems, but great ones not just solves the problem, but intuitively give users the look and feel of the solvable problem. Applications are usually themed to match of its purpose and value. The twitter application has little bird icons, same as its name and its purpose. Facebook’s simplistic approach made the users visit their site on daily basis because the site’s look and feel is pretty straight forward.

What’s good about Liferay is that all of its components, from themes, portlets to extensions and hooks are all customizable and injectable – injectable meaning that developers can create the components independently and plug it. Themes is not an exception:

Download the Liferay Eclipse Plugin

Go to > Help > Eclipse Marketplace > Search for “Liferay”

Once installed, Liferay Tool bar should be displayed.

Note: Install the LiferaySDK and Liferay Portal Instance with the chosen Application Server (I used the lightweight one, Liferay bundled with Tomcat).

Create the Theme on your sketch pad first (plan it)

Not a sketch, but I did pull out a template from http://www.freecsstemplates.org

A simple bar, content bar and menu / navigation bar should do it. Now to create the actual project and use the theme, go to the next step below.

Create the Theme Project

New > Project > Liferay Portal > Choose Themes

Creating a new project will generate default sources, folders: css, images, js and templates. Now, an important note to this one, these are not the files that you need to edit. I personally use it as my reference.

Re-create these folders under the _diffs directory. This is where the theme development begins.

  • CSS: create a custom.css file on the CSS directory under _diffs
  • VM: Create a portal_normal.vm file under templates of _diffs

Paste the source code of these respectively. portal_normal.vm and custom.vm

Deploy

Test, Hit Right Click Project > Liferay > SDK > Deploy Target

Test Locally

Login > Go To Pages > Site Pages and Choose the Theme!

Your theme is now ready!

Download the Project here.

Reference: Liferay – Simple Theme Development from our JCG partner Alvin Reyes at the Alvin “Jay” Reyes Blog blog.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

Leave a Reply


7 − three =



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close