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.