[quote]First I tried using cmsfn.children 
(http://documentation.magnolia-cms.com/modules/templating-samples.html)
[#list cmsfn.children(member, "mgnl:nodeData") as child]
------------------------------------------
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)
[/quote]

Yeah, it would not. What you were telling engine to do was to list all child 
nodes of type node data, but what you actually want is to list all properties. 
This would work if each of your members ahd some child nodes which it doesn't 
(i assume).

[quote]
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?[/quote]

Now that should actually work. However it would work only if each of your 
members had defined such property. If there is one that doesn't have it, 
freemarker would spit the error you see. Try to change the code to 
${member.firstName!"First name not set"} and see what happens.

Another issue there might be that you actually get more nodes then you really 
want. Your query - "select * from nt:base where jcr:path like '/members/%'" 
"sql" "nt:base") says to give children of nt:base which is basically anything. 
What you want is to replace nt:base with whatever name you choose for your data 
type. I'd guess most likely "member" or "members".

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