Override default freemarker error template
knowledge-article-header-disclaimer-how-to
knowledge-article-header-disclaimer
legacy-article
learn-legacy-article-disclaimer-text
Issue
- You need to change the default behavior of the default freemarker template showing the entire error code and want to show a different template instead
Resolution
- Even though you’re using the RETHROW option an error message shows whenever the template fails. This happens because the default error templates from the Liferay bundle are showing this exception:
- You can change this behavior by placing your template in the [TOMCAT_HOME]/webapps/ROOT/WEB-INF/classes directory
- After successfully locating the template, change the following properties in the portal-ext.properties file to match the location and name of your template
portlet.display.templates.error[ftl]=[TOMCAT_HOME]/webapps/ROOT/WEB-INF/classes/portlet_display_template_error.ftl
portlet.display.templates.error[vm]=[TOMCAT_HOME]/webapps/ROOT/WEB-INF/classes/portlet_display_template_error.vm
- Restart your Liferay bundle and check.
Additional information
did-this-article-resolve-your-issue