[ 
http://jira.magnolia-cms.com/browse/MGNLSTK-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=26633#action_26633
 ] 

Grégory Joseph commented on MGNLSTK-577:
----------------------------------------

Sure, it will documented (it's just brand new) - it's configured in this 
location, because it's part of the FreeMarker configuration (i.e these 
variables are available system-wide to anything that uses FreeMarker, not just 
template and paragraph renderers)

> 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]>
----------------------------------------------------------------

Reply via email to