-
Improvement
-
Resolution: Fixed
-
Major
-
1.2.3
-
-
Empty show more show less
It would be nice to be able to register classes under the template-renderer en paragraph-renderer configurations, so that those classes would be added to the template rendering context.
STKTemplateRenderer could get a Map property like 'classesToInclude'
it would be nice if modules/standard-templating-kit/template-renderers/stk would be watched, and new classes would be added on the fly through content2bean. STKTemplateRenderer would have to propagate this map to FreemarkerHelper
you could do something like this in FreemarkerHelper:
TemplateHashModel staticModels = wrapper.getStaticModels(); try { for (String name : classesToInclude.keySet()) { TemplateHashModel model = (TemplateHashModel) staticModels.get(classesToInclude.get(name)); map.put(name, model); } } catch (TemplateModelException e) { e.printStackTrace(); }
That way all static methods of the class are available.
- is related to
-
MAGNOLIA-1469 Make Freemarker more configurable through admininterface
- Closed
-
MAGNOLIA-2383 TemplateRenderer should be instantiated using content2bean
- Closed
-
MAGNOLIA-3087 Allow configuration of shared variables for FreeMarker
- Closed