legacy-knowledge-base
公開されました Jun. 30, 2025

HTML content in Text fields is escaped after migrating from Liferay DXP 7.3 to 2025.Q1

投稿者

Daniel Martinez Cisneros

knowledge-article-header-disclaimer-how-to

knowledge-article-header-disclaimer

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • After migrating from Liferay DXP 7.3 to 2025.Q1, HTML content within web content "Text" fields is no longer interpreted by Freemarker templates using ${field.getData()}. It is displayed as escaped HTML.

Environment

  • Liferay DXP 7.3
  • Liferay DXP 2025.Q1+

Resolution

  • Use the following Freemarker code to unescape the HTML content from the text field:
${htmlUtil.unescape(fieldName.getData())}

Additional Information

  • While using "Rich Text" fields is generally recommended for HTML content, this workaround helps prevent data loss during migrations and avoids manual re-entry of content when dealing with existing "Text" fields containing HTML.
did-this-article-resolve-your-issue

legacy-knowledge-base