Updating 7.0 Theme Templates to 7.2

Liferay DXP 7.0 theme templates and Liferay DXP 7.2 theme templates are essentially the same. Here are the main changes:

  • Velocity templates were deprecated in Liferay Portal CE 7.0 and are now removed in favor of FreeMarker templates in Liferay DXP 7.2.

Key reasons for using FreeMarker templates and removing Velocity templates are these:

  • FreeMarker is developed and maintained regularly, while Velocity is no longer actively being developed.

  • FreeMarker is faster and supports more sophisticated macros.

  • FreeMarker supports using taglibs directly rather than requiring a method to represent them. You can pass body content to them, parameters, etc.

If you haven’t converted your Velocity theme templates to FreeMarker, you must convert your Velocity theme templates to FreeMarker now.

The gulp upgrade command reports the required theme template changes in the log. For example, here is the gulp upgrade log for the Westeros Bank theme:

----------------------------------------------------------------
 Liferay Upgrade (7.0 to 7.1)
----------------------------------------------------------------

Renamed aui.scss to clay.scss
File: footer.ftl
    Warning: .container-fluid-1280 has been deprecated. Please use 
    .container-fluid.container-fluid-max-xl instead.
File: portal_normal.ftl
    Warning: .navbar-header has been removed. This container should be 
    removed in most cases. Please, use your own container if necessary.

The log warns about removed and deprecated code and suggests replacements when applicable. For reference, the main changes between Liferay DXP 7.0 themes and Liferay DXP 7.2 themes appear below:

  • List items inside a container with the list-inline class now require the list-inline-item class.

  • The container-fluid-1280 class has been deprecated. Please use container-fluid container-fluid-max-xl instead.

  • Responsive navbar behaviors are now applied to the navbar class via the required navbar-expand-{breakpoint} class.

  • The navbar-toggle class is now navbar-toggler and has different inner markup.

  • The navbar-header class has been removed. This container should be removed in most cases. Please, use your own container if necessary.

In this section you’ll learn how to update various theme templates to Liferay DXP 7.2.

Let’s Go

« Updating 7.0 ImportsUpdating 7.0 Theme Templates »
这篇文章有帮助吗?
0 人中有 0 人觉得有帮助