1<#assign assetCategoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryService")>
2<#assign OrderByComparatorFactoryUtil = staticUtil["com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil"]>
3<#assign orderby = OrderByComparatorFactoryUtil.create("ASSETCATEGORY", ["title", true])>
4<#assign myparam = httpUtil.getParameter(currentURL, "p_r_p_categoryId", false) >
5<#assign counter = 00>
6
7
8
9
10
11
12
13
14<div id="customCategoriesNavigation" class="menu-fnmt">
15 <#if entries?has_content>
16 <#list entries as entry>
17 <#--
18 <div class="panel-heading results-header">
19 <h3>
20 ${entry.getUnambiguousTitle(entries, themeDisplay.getSiteGroupId(), themeDisplay.getLocale())}
21 </h3>
22 </div>
23 -->
24 <div class="panel-body">
25 <#assign categories = assetCategoryService.getVocabularyRootCategories(groupId, entry.getVocabularyId(), -1, -1, orderby)/>
26
27 <@displayCategories categories=categories curlevel=1/>
28 </div>
29 </#list>
30 </#if>
31</div>
32
33
34
35
36
37
38
39
40<#macro displayCategories
41 categories
42 curlevel
43>
44 <#if categories?has_content>
45 <#if curlevel == 2>
46 <#assign counter=counter+1>
47 <ul id="categorySection_${counter}" class="categories level-${curlevel } owl-carousel" >
48 <#elseif curlevel == 1>
49 <ul class="categories level-${curlevel }" >
50 </#if>
51 <#list categories as category>
52 <#if curlevel == 1>
53 <li id="categoryItem_${counter}" class="category-item level-${curlevel }">
54 <#else>
55 <li class="category-item level-${curlevel }" data-hash="${counter}-${category?index}">
56 </#if>
57 <#assign categoryURL = renderResponse.createRenderURL() />
58
59 ${categoryURL.setParameter("resetCur", "true")}
60 ${categoryURL.setParameter("categoryId", category.getCategoryId()?string)}
61
62 <#if curlevel == 1>
63 <#if category.getCategoryId()?string == myparam>
64 <span class="category-age" name="${category.getCategoryId()?string}"><a class="selected font-weight-bold" href="${categoryURL}">${category.getName()}</a></span>
65 <#assign categoriaPadre = category.getCategoryId()?string />
66 <script>
67 $('.category-age[name="${categoriaPadre}"]').parent().addClass("selected");
68 </script>
69 <#else>
70 <span class="category-age" name="${category.getCategoryId()?string}"><a href="${categoryURL}">${category.getName()}</a></span>
71 <#assign categoriaPadre = category.getCategoryId()?string />
72 </#if>
73
74 <#else >
75 <#if category.getCategoryId()?string == myparam>
76 <a class="selected font-weight-bold" href="${categoryURL}">${category.getName()}</a>
77 <script>
78 $('.category-age[name="${categoriaPadre}"]').parent().addClass("selected");
79 </script>
80 <#else>
81 <a href="${categoryURL}">${category.getName()}</a>
82 </#if>
83 </#if>
84
85 <#assign childCategories = assetCategoryService.getChildCategories(category.getCategoryId())/>
86 <@displayCategories categories=childCategories curlevel=(curlevel+1) />
87 </li>
88 </#list>
89 </ul>
90 <#else>
91 <#if curlevel == 2>
92 <#assign counter=counter+1>
93 </#if>
94 </#if>
95</#macro>
96
97<style>
98 #main-content .portlet-body div.menu-fnmt a {
99 color:#23334a;
100 }
101
102</style>