cancel
Showing results for 
Search instead for 
Did you mean: 

get document.children properties using html.ftl

e-no91
Champ in-the-making
Champ in-the-making
I wanted to get a document's children's properties but i kept on getting undefined error.

I pass the folder through js as
mail.execute(document);
And in html.ftl
${document.children[0].properties["cm:creator"]}

I've checked by rewrting my js as
mail.execute(document.children[0);
and the properties as
${document.properties["cm:creator"]}
And it returns the correct result.

Or, is there a way to get the document's folder in the ftl?

Thank you in advance!
1 REPLY 1

kaynezhang
World-Class Innovator
World-Class Innovator
It seems nothing is wrong ,you can try following code and see what it prints

<#list document.children as child>
   <#if child.isContainer>
   Path: ${child.displayPath}

       <#else>
         ${child.properties.creator}
    ${child.name}
         ${document.properties["my:myprop"]}

       </#if>
   </#if>
</#list>