<#if isRoot> [{ "text": "<@s.m "template.root"/>", "classes": "folder" <#if tplList?size gt 0>, "expanded": true, "children": [ <#list tplList as tpl> { "id": "${tpl.name}", "text": "${tpl.filename}", "classes": "${tpl.directory?string('folder','file')}", "hasChildren": ${tpl.directory?string('true','false')} }<#if tpl_has_next>, ] }] <#else> [ <#list tplList as tpl> { "id": "${tpl.name}", "text": "${tpl.filename}", "classes": "${tpl.directory?string('folder','file')}", "hasChildren": ${tpl.directory?string('true','false')} }<#if tpl_has_next>, ]