NIHVIVO-2071 Include pageSetup.ftl in every page template. Use to generate a body class value, and apply to body element in page templates.

This commit is contained in:
rjy7 2011-02-08 21:07:16 +00:00
parent b3c13118d9
commit 17d41d281a
3 changed files with 25 additions and 1 deletions

View file

@ -55,6 +55,13 @@ public class TemplateProcessingHelper {
// can be used in directives.
env.setCustomAttribute("request", request);
env.setCustomAttribute("context", context);
// Define a setup template to be included by every page template
String templateType = (String) map.get("templateType");
if (templateType != null && templateType.equals(FreemarkerHttpServlet.PAGE_TEMPLATE_TYPE)) {
env.include(getTemplate("pageSetup.ftl"));
}
env.process();
} catch (TemplateException e) {
log.error("Template Exception creating processing environment", e);