AnsweredAssumed Answered

Error in freemarker template

Question asked by ricny046 on Dec 16, 2008
Latest reply on Dec 16, 2008 by ricny046
Hello!

I'm trying to build a freemarker template that lists all the articles I have in a Web Project:

articles.html.ftl

<#ftl ns_prefixes={"D":"http://www.alfresco.org/alfresco/pr", "pr":"http://www.alfresco.org/alfresco/pr"}>
<#assign docs = alf.parseXMLDocuments('article', '/articles')>

<#list docs as doc>
       <h3>${doc.title}</h3>
    </#list>


But when I do this I only gets an error saying Expecting a string, date or number here, Expression doc.title is instead a freemarker.ext.dom.NodeListModel.

If I skip the ${doc.title} and put in just a literal string like this: <h3>test</h3> it writes out test for every article so it must at least find them.

Does anyone know twhat I should write instead of ${doc.title}?

Outcomes