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

OnePlus 3T in 2017

Hi there, I just bought OnePlus 3T, why? Even when OnePlus 5 is out and OnePlus 5T looming around the corner. Top five reasons why the 3T might just be a very sound investment if you are in the market for a new phone. 3T is going for a relatively cheap price. Its wickedly fast. Its 1080p display. Its software. OnePlus 5 isnt a huge update. Key Specs Display - 5.50-inch Processor - 1.6GHz quad-core Front Camera - 16-megapixel Resolution - 1080x1920 pixels RAM - 6GB OS - Android 7.1.1 Storage - 64GB Rear Camera - 16-megapixel Battery Capacity - 3400mAh Overall Rating 9/10 - Design 9/10 - Display 9/10 - Software 9/10 - Performance 9/10 - Battery life 9/10 - Camera 9/10 - Value for money Important - No other phone with all round 9's. Good Solid system and app performance Very good battery life Competent set of cameras Amazing premium build quality Good value for money Bad Nothing as yet

Google tablet to give Apple a touch of its own medicine

Google is trying to one-up Apple, showing off designs for a new tablet computer based on its Chrome operating system that would be a direct rival to the iPad. Just weeks after launching its own iPhone competitor in the US, the Nexus One, Google might soon extend its competition with Apple further as it seeks to push its search and other products on to as many devices as possible. Google's user interface designer, Glen Murphy, published mock-ups of a Google tablet on the search giant's Chromium.org website, along with a video of how users would interact with the device. Late last year Google announced Chrome OS, an operating system predominantly for small netbooks that would be based around the web browser, providing quick boot times and easy access to Google's array of online services. The first Chrome OS netbooks are due to arrive this year, but Google is now considering extending the platform to other devices including tablets, desktops and even big screen TVs. Chrome OS ...

Apple's iPhone 4.0 software to deliver multitasking support

Apple this summer will go a long way towards silencing critics and catering to one of the most prevalent demands of its iPhone user base, when it introduces a multitasking solution through the handset's 4.0 software update that will finally allow several third party apps to run concurrently and in the background. For more Info.