Ok. The next step wasn't as easy as I thought.
Question: [b]How do I get node data from a node in Freemarker?[/b]

First I tried using cmsfn.children 
(http://documentation.magnolia-cms.com/modules/templating-samples.html)
------------------------------------------
[#assign members = cmsfn.search("data" "select * from nt:base where jcr:path 
like '/members/%'" "sql" "nt:base") /]
[#list members as member]
        <h2>${member}</h2>
        [#list cmsfn.children(member, "mgnl:nodeData") as child]
                ${child}
        [/#list]
[/#list]
------------------------------------------
I didn't throw any errors, but it didn't show any node data either, just node 
paths of each member (whats inside the h2 tag)

The I tried with accessing content 
(http://documentation.magnolia-cms.com/reference/templating/freemarker.html)
------------------------------------------
[#assign members = cmsfn.search("data" "select * from nt:base where jcr:path 
like '/members/%'" "sql" "nt:base") /]
[#list members as member]
        <h2>${member}</h2>
        ${member.firstName}
[/#list]
------------------------------------------
This gave me the following error:
"Expression member.firstName is undefined on line 4, column 11 in 
templates/components/listOfMembers.ftl."
firstName is indeed a node data for all members, but i am apperantly using an 
incorrect syntax.

Now I do not know how to continue. Any ideas?

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=92cc9fac-0e0e-48f6-b13d-d3b888f441bc


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to