Hi gang,

Currently working on a FreemarkerParagraphRenderer, I'd like to gather opinions about the syntax to be used. There are plenty of options and approaches. I currently see the following (if implementable at all) :

${foo} : would return a node (Content)
${foo['bar']} : would return the bar property (NodeData) of the foo node
${foo.baz} : would return foo's child node called baz
<#list foo as n> ... : would loop over the properties of foo
<#list foo.children as n> ... : would loop over the child nodes of foo

I have a few doubts:
* since properties could be used more often than subnodes in templates, it might be interesting to revert the [] notation: foo.bar would mean "bar property of foo" while foo['bar'] would mean "bar child of foo", eventhough that doesn't seem very intuitive from my programmer's point of view. * the iterators i propose here are inconsistent with the properties/ child notation, and would prevent access to a sub node called "children". * how to expose other Content properties, such as handle and uuid? Chris suggests using [EMAIL PROTECTED] or [EMAIL PROTECTED] OTOH, I'm not convinced these should be used very often in templates, so maybe having a few custom directives would be good enough (<@uuid>${foo}</ @uuid>)

I'm currently writing tests which will try to assert the above syntax, and will commit them (commented out) so maybe that can also serve as a basis for discussion.

Please suggest better approaches or approve these, since I'm really not convinced by the whole thing.

Thanks,

greg

----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------

Reply via email to