Themes

A Liferay Theme is the overall look and feel for a site. Themes are a combination of CSS, JavaScript, HTML, and FreeMarker templates. Although the default themes are nice, you may wish to create your own custom look and feel for your site. Liferay DXP provides several tools and environments that you can use to create themes:

What if you only wish to make a minor change to the overall look and feel? Let’s say you just want to change a menu animation. Instead of creating an entire theme for this single modification, you can create a Themelet. Themelets are modular, customizable, reusable, shareable pieces of code that extend a theme. They enable reusable code for themes. Instead of rewriting the code each time, you can use the same themelet in each theme.

Liferay has its own set of base themes, called styled and unstyled that create the default look and feel you see at first start. The styled theme inherits from the unstyled theme, and simply adds some additional styling on top. These same base themes are used to create a custom theme. See the User Profile Theme, which uses the styled theme as its base. Using a base theme as your foundation, you can then make your customizations to the theme files. To modify the theme, mirror the folder structure of the files you wish to change and copy them into your theme. Place the modified files in the src folder of your theme if using the Liferay Theme Generator, or copy them into the webapp folder of your theme if using Liferay Developer Studio. Build the theme to apply the changes.

Once your theme is developed it is packaged as a WAR (Web application ARchive) file and can be deployed to the server, either manually or using build tools. Apply your theme to your pages through the Look and Feel menu. The only limitation is your imagination.

« Introduction to Themes and Layout TemplatesLiferay Theme Generator »
Was this article helpful?
0 out of 0 found this helpful