<#if isRoot> [{ "text": "<@s.m "global.root"/>", "classes": "folder" <#if list?size gt 0>, "expanded": true, "children": [ <#list list as channel> { "id": "${channel.id}", "text": "${channel.name}", "classes": "<#if channel.child?size gt 0>folder<#else>file", "hasChildren": <#if channel.child?size gt 0>true<#else>false }<#if channel_has_next>, ] }] <#else> [ <#list list as channel> { "id": "${channel.id}", "text": "${channel.name}", "classes": "<#if channel.child?size gt 0>folder<#else>file", "hasChildren": <#if channel.child?size gt 0>true<#else>false }<#if channel_has_next>, ]