diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/directives/DumpDataModelDirective.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/directives/DumpDataModelDirective.java index 8510dc9b4..6bbe404f8 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/directives/DumpDataModelDirective.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/directives/DumpDataModelDirective.java @@ -72,7 +72,10 @@ public class DumpDataModelDirective implements TemplateDirectiveModel { map.put("stylesheets", dataModel.get("stylesheets")); map.put("dump", dataModel.get("dump")); // Put the current datamodel into the new datamodel so its values can be dumped with the dump directive + // RY Another way to do this would be to loop through the data model here, merging each variable with + // the dump-var.ftl template and adding it to the output string. map.put("datamodel", dataModel); + map.put("containingTemplate", env.getTemplate().getName()); FreemarkerHelper helper = new FreemarkerHelper(); String output = helper.mergeMapToTemplate(templateName, map, config); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/directives/DumpDirective.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/directives/DumpDirective.java index 2c72e2de0..77846011e 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/directives/DumpDirective.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/directives/DumpDirective.java @@ -105,13 +105,9 @@ public class DumpDirective implements TemplateDirectiveModel { map.put("type", type); map.put("stylesheets", dataModel.get("stylesheets")); - //map.put("dump", this); - - Configuration config = env.getConfiguration(); - String templateName = "dump-var.ftl"; - FreemarkerHelper helper = new FreemarkerHelper(); - String output = helper.mergeMapToTemplate(templateName, map, config); + //map.put("dump", this); // would need for recursive calls + String output = new FreemarkerHelper().mergeMapToTemplate("dump-var.ftl", map, env.getConfiguration()); Writer out = env.getOut(); out.write(output); diff --git a/webapp/web/templates/freemarker/body/partials/dump/dump-datamodel.ftl b/webapp/web/templates/freemarker/body/partials/dump/dump-datamodel.ftl index 34936715e..a4647ce5f 100644 --- a/webapp/web/templates/freemarker/body/partials/dump/dump-datamodel.ftl +++ b/webapp/web/templates/freemarker/body/partials/dump/dump-datamodel.ftl @@ -4,7 +4,7 @@
-

Template data model dump

+

Data Model Dump for Template ${containingTemplate}

Variables