Skip to main content

Liferay 7 - Theme via Maven + IDE

Liferay IDE 3.1 M2 has been released recently.
Download the Liferay IDE - https://web.liferay.com/downloads/liferay-projects/liferay-ide
Follow the below steps to create themes in Liferay 7 using IDE 3.1 M2.

1. Go to Liferay workspace and create "New Liferay Module Project".

Project Name : sample-theme
Build type : maven-module / gradle-module (your choice, i prefer maven-module)
Project Template Name : theme

Note: After creating theme module project. Project structure is created to develop custom theme.

2. Now build Theme using Maven.

- In Eclipse select "Run" -> "Run Configurations"
- Right click "Maven Build" -> New
- Name :: Build-Theme
- Base directory :: ${workspace_loc:/lfg-theme}
- Goal :: clean package
- Click Apply
- Click Run
- Check in Console if the Build is Successful

Building would have placed all the classic styled theme files under "sample-theme/target"

3. As we want to override the classic theme, we will place our files under "sample-theme/src/main/webapp" folder.

Let's override "portal_normal.ftl" file.
- Create folder named "templates" under "sample-theme/src/main/webapp/".
- Copy file "portal_normal.ftl" from "sample-theme/target/build-theme/templates"
- Paste file "portal_normal.ftl" to "sample-theme/src/main/webapp/templates"
- Make a change in the file, like add a few words with in the body tag.

4. Build Theme using Maven, using the "Run Configurations" created in Step 2.

5. Lets Deploy our Theme to Liferay

- Start up your Liferay7 instance, if not already running.
- Copy the "sample-theme-1.0.0-SNAPSHOT.war" from "D:\Workspace\Liferay7\lfg-theme\target".
- Paste "sample-theme-1.0.0-SNAPSHOT.war" to "D:\Liferay\Community Edition 7.0\liferay-ce-portal-7.0-ga3\deploy".
- See Liferay console / logs on the deployment of your portlet.

Note: Wait for the deployment of Theme to complete, till you see "1 theme sample-theme is available for use"

6. In Liferay configure the page to use your deployed theme and see the changes.

- Create a New Page
- "Configure Page" & go to "Look and Feel"
- Select radio button "Define a specific look and feel for this page."
- Scroll down, select "Change Current Theme"
- Chose our "Sample-Theme" and save

Comments

Popular posts from this blog

Everything about Java 8

The following post is a comprehensive summary of the developer-facing changes coming in Java 8. This next iteration of the JDK is currently scheduled for general availability in  September 2013 . Read More

Google leaps language barrier with translator phone

GOOGLE is developing software for the first phone capable of translating foreign languages almost instantly — like the Babel Fish in The Hitchhiker’s Guide to the Galaxy. By building on existing technologies in voice recognition and automatic translation, Google hopes to have a basic system ready within a couple of years. If it works, it could eventually transform communication among speakers of the world’s 6,000-plus languages. The company has already created an automatic system for translating text on computers, which is being honed by scanning millions of multi-lingual websites and documents. So far it covers 52 languages, adding Haitian Creole last week. Google also has a voice recognition system that enables phone users to conduct web searches by speaking commands into their phones rather than typing them in. Now it is working on combining the two technologies to produce software capable of understanding a caller’s voice and translating it into a synthetic equivalent in a foreign ...

Keyboard First Impressions: Kinesis Advantage Mechanical Ergonomic Keyboard

An ergonomic keyboard with mechanical switches that’s looking to attract users interesting in a high quality, highly ergonomic offering and don’t mind the rather steep learning curve or the price. The  TECK  isn’t the only such keyboard, of course, and I decided to see what other mechanical switch ergonomic keyboards I could get for comparison. Next up on the list is the granddaddy of high-end ergonomic keyboards, the  Kinesis Contour Advantage . I wanted to provide my first impressions of the Kinesis, along with some thoughts on the initial switch and the learning curve. This time, I also made the effort to put together a video of my first few minutes of typing. It actually wasn’t as bad as with the TECK, but that’s likely due to the fact that I already lost many of my typing conventions when I made that switch earlier this year. I’ll start with the video, where I take a typing test on four different keyboards and provide some thoughts on the experience, and then ...