Content wrapper hides java attributes and methods from freemarker (e.g.
myContent.class.name)
---------------------------------------------------------------------------------------------
Key: MAGNOLIA-3572
URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3572
Project: Magnolia
Issue Type: Bug
Components: freemarker, templating
Affects Versions: 4.4.2
Reporter: Will Scheidegger
Assignee: Boris Kraft
The "specificities" (see
http://documentation.magnolia-cms.com/reference/templating/freemarker.html#WorkingwithMagnoliacontent)
of how Magnolia handles content objects in Freemarker templates break all
access to regular methods of the java object since the dot-notation is pretty
much kidnapped and only node datas are returned. To "fix" that, special content
properties starting with @... were introduced.
It would been cleaner if the "@..." notation would have been used for accessing
jcr attributes (i.e. node datas) and the rest would behave normally, so
${myContent.class} should return the Class object my calling the getClass()
method.
${myContent.@class} should return the JCR attribute named "class"
Of course this might be my personal preference, but fact is that I cannot call
the getClass() method the way the wrapper ojbect works now but you could get
both (JCR attribute and method()) the other way around.
--
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]>
----------------------------------------------------------------