When it comes to Liferay create theme development, the process is pretty much the same as creating a portlet on the same platform.
The project theme I am creating will be named Blue Earth for the purposes of this tutorial, and the display name will also be Blue Earth.
Liferay Create Theme
- First, you need to head over to File > New > Liferay project.
- Then fill in your project name and display name.
- You then need to choose a build type, as well as Liferay runtime and Plugins SDK. We recommend that you choose the Ant build type.
- You then need to choose Theme for your plugin type before clicking Next. You will then be asked to select a theme parent from the Liferay themes. Whichever theme you chose will inherit the parent theme’s styling.
- You can choose from either the _styled theme or the _unstyled theme. There is also a classic theme.
- Once selected, now chose your Liferay themes framework.
- Then click Finish.
- Now you need to go to the Liferay theme directory in the plugins SDK and enter either of the following commands (depending on your operating system):
For macs: ./create/sh blue-earth “Blue Earth”
For Windows: create.bat blue-earth “Blue Earth”
There will be a blank theme in your Liferay theme folder, which requires a base theme that will serve as your default.
How To Set A Liferay Base Theme
All Liferay themes exist on two base themes:
Your brand new theme will be based on these but will contain little to no styling. Make use of an existing theme’s styling by setting the theme as the base theme.
Base themes come in layers. _Unstyled is added first, before _styled adds the basic elements.
When you set a new base theme, it will be piled on top of _styled.
Once the base themes are added, you can add your own custom style on top.