<#macro chipTree filepath prefix suffix>
    <@_templateList path='include'+filepath orderField='createDate'>
        <#list list as a>
            <li>
                <#local path=filepath+'/'+a.fileName>
            <#if a.directory>
                <a href="javascript:;" onclick="return false;">${a.fileName} </a>
                <ul>
                    <@chipTree path prefix suffix/>
                </ul>
            <#else>
                <@_placeMetadata path=path>
                    <a href="javascript:;" onclick="DWZ.codemirror.instances[$('textarea.code',navTab.getCurrentPanel()).data('id')].replaceSelection('${(prefix+path+suffix)?js_string} ${(object.alias)?has_content?then('<#-- '+object.alias+' -->','')?js_string}');$.pdialog.closeCurrent();return false;">
                        ${(object.alias)?has_content?then(object.alias+' ('+a.fileName+')',a.fileName)}
                    </a>
                </@_placeMetadata>
            </#if>
            </li>
        <#else>
            <li><a><@t.page 'empty_directory'/></a></li>
        </#list>
    </@_templateList>
</#macro>
<div class="pageFormContent" layoutH>
    <ul class="tree treeFolder">
<@chipTree '' '<@_includePlace path="' '"/>'/>
    </ul>
</div>