<#if parentId?has_content>
<ul>
    <@_categoryList advanced=true parentId=parentId pageSize=500>
        <#list page.list as a>
            <#if !(currentCategoryId?has_content) || !(a.id?string=currentCategoryId)>
                <li<#if a.childIds?has_content> _src="cmsCategory/lookup.html?currentCategoryId=${currentCategoryId!}&parentId=${a.id}&field=${field!'categoryId'}"</#if>>
                    <a href="javascript:;" class="exclude-translate" onclick="$.bringBack({parentId:'${a.id}',${field!'categoryId'}:'${a.id}', categoryName:'${a.name}'});return false;">${a.name!}</a>
                </li>
            </#if>
        </#list>
    </@_categoryList>
</ul>
<#else>
<div class="pageFormContent" layoutH>
    <ul class="tree treeFolder expand">
        <li>
            <a href="javascript:;" onclick="$.bringBack({${field!'categoryId'}:'',categoryId:'', categoryName:'',parentId:''});return false;"><@t.page 'button.clear_select'/></a>
        </li>
        <@_categoryList advanced=true parentId=parentId pageSize=500>
        <#list page.list as a>
            <#if !(currentCategoryId?has_content) || !(a.id?string=currentCategoryId)>
                <li<#if a.childIds?has_content> _src="cmsCategory/lookup.html?currentCategoryId=${currentCategoryId!}&parentId=${a.id}&field=${field!'categoryId'}"</#if>>
                    <a href="javascript:;" class="exclude-translate" onclick="$.bringBack({parentId:'${a.id}',${field!'categoryId'}:'${a.id}', categoryName:'${a.name}'});return false;">${a.name!}</a>
                </li>
            </#if>
        <#else>
            <li><a><@t.page 'empty_directory'/></a></li>
        </#list>
    </@_categoryList>
    </ul>
</div>
<div class="formBar">
    <ul>
        <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
    </ul>
</div>
</#if>