Legacy Knowledge Base
Published Jul. 2, 2025

Custom Layout Templates shows source code in Nested Application Portlet

Written By

Kanchan Bisht

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

Issue

  • Configure the Nested Application Portlet to appear with any of the custom layouts whenever it is used. Instead of the layout's rendering, the source code is shown.

  • Steps to reproduce
    1) Deploy the custom layout war file
    2) Startup Liferay 7.1 with Fix pack 16 installed
    3) Create a page and click on the Look and Feel tab
    4) Select the 'Define a specific look and feel for this page' option
    5) Scroll down and click on Change Current Theme
    6) Select the test-layout
    7) Save it and go to the page
    8) Place a Nested Applications portlet on the page
    9) Go to the configuration of the Nested Applications portlet
    10)Scroll down and select the 'Test 2 Columns' option
    11)Click on save
    Expected behavior: The selected layout is used and the Nested application portlet is empty
    Actual behavior: The selected layout is used but the source code is visible
  • Note: On Fix pack 10, this behavior works properly. It appears that the specific behavior mentioned occurs with Fix Pack 11 and onwards. 

Environment

  • Liferay DXP 7.1 Fix Pack 16

Resolution

  • Velocity layout templates are deprecated in 7.1, which means the generator is generating a FTL file instead of a TPL file, referring to: https://github.com/liferay/liferay-js-themes-toolkit/issues/129 and https://help.liferay.com/hc/en-us/articles/360017887832-Creating-Layout-Templates-Manually-#anatomy
  • Liferay had a modification in dxp-11 that affects the nested portlet visible in the LPS-92167
  • In the customer's theme, if the custom test2col.tpl extension is changed to .ftl and also modify /layouttpl/custom/test2col.tpl to .ftl in liferay-look-and-feel.xml, then the layout looks like correctly processed on the Portal, with no error in the console.
  • As a result, it has been proposed that the above-mentioned method or creating a new theme and layout with the toolkit be used in this circumstance (users can update the liferay-theme-generator with npm install generator-liferay-theme).

Additional Information

  • The .war file as well the source code as an attachment.
Did this article resolve your issue ?

Legacy Knowledge Base