I am facing a problem in getting the categories in Liferay 7, I am using the ADT to get categories of specific vocabulary as following :
<#if entries?has_content>
 <#list entries as entry>
  <#assign categories = entry.getCategories()>
  <#list categories as category>
    <a>${category.getName()}</a>
  </#list>
 </#list>
</#if>
entry type is : AssetVocabulary
my problem is : I am getting the whole categories and sub categories of the vocabulary
for example I have this categories :
- fruits ( apples - banana )
- vegetables
- meat
so in the results I am getting all categories and sub categories as :
- fruits
- apples
- banana
- vegetables
- meat
but what i need is :
- fruits
- vegetables
- meat
I hope that I can find help here , thank you in advance
