[
http://jira.magnolia-cms.com/browse/MGNLSTK-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=26649#action_26649
]
Ernst Bunders commented on MGNLSTK-577:
---------------------------------------
Ah, just new. That's good. But from a multi-site perspective, is it desirable
to configure this stuff globally? Wouldn't it make more sense to be able to
configure this for each site? (of course my solution doesn't allow for that
either). I guess that there are quite a few things you would like to be able to
do on the site level, when you think about it...
Never the less, that is no big deal, and it seems like a fine solution to me.
Thanks,
> Make it configurable what classes are included in the freemarker template
> rendering context
> -------------------------------------------------------------------------------------------
>
> Key: MGNLSTK-577
> URL: http://jira.magnolia-cms.com/browse/MGNLSTK-577
> Project: Magnolia Standard Templating Kit
> Issue Type: Improvement
> Components: templates
> Affects Versions: 1.2.3
> Reporter: Ernst Bunders
> Assignee: Grégory Joseph
> Fix For: 1.3
>
>
> 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:
> {code}
> 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();
> }
> {code}
> That way all static methods of the class are available.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------