1<#assign propertyKey = 'showInFilterActualidad'>
2
3<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")>
4<#assign AssetCategoryPropertyLocalService = serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService")>
5<#assign companyId = themeDisplay.getCompanyId()>
6<#assign groupIds = [themeDisplay.getSiteGroupId()]>
7<#assign title = '%'>
8<#assign parentCategoryIds = [0]>
9
10<#assign urlSinFlitrar = themeDisplay.getURLCurrent()>
11<#assign url = urlSinFlitrar?keep_before_last("/-/categories/")>
12<#assign url = url?keep_before_last("?")>
13<#assign urlHasCategorias = urlSinFlitrar?keep_after_last("/-/categories/")>
14
15<#if urlSinFlitrar?contains("p_r_p_categoryId=")>
16 <#assign urlHasCategorias = 'KK'>
17</#if>
18
19<div class="filtro row">
20 <div class="dropdown-container col-md-8 col-xl-6">
21 <div class="row">
22 <div class="col-4 col-sm-6">
23 <div class="dropdown">
24 <button class="dropdown-button">
25 <#if (textoAntiguosSelector.getData())??>
26 (textoAntiguosSelector.getData()) <i class="icon-chevron-down"></i>
27 <#else><#--Pendiente de cambiar "Filtros" en función del idioma-->
28 Filtro <i class="icon-chevron-down"></i>
29 </#if>
30 </button>
31 <ul class="dropdown-content">
32 <#-- Recuperamos las categoras con la propierdad definida por la variable 'propertyKey'-->
33 <#if entries?has_content>
34 <#list entries as curVocabulary>
35 <#assign vocabularyIds = [curVocabulary.getVocabularyId()]>
36 <#assign categoriesSearchResult = AssetCategoryLocalService.searchCategories(companyId, groupIds, title, parentCategoryIds, vocabularyIds, -1, -1)>
37 <#list categoriesSearchResult.getBaseModels() as category>
38 <#attempt>
39 <#assign categoryProperty = AssetCategoryPropertyLocalService.getCategoryProperty(category.getCategoryId(), propertyKey)>
40 <#if categoryProperty.getValue() == 'true'>
41 <#assign parentCategoryIds = [category.getCategoryId()]>
42 <#assign subCategoriesSearchResult = AssetCategoryLocalService.searchCategories(companyId, groupIds, title, parentCategoryIds, vocabularyIds, -1, -1)>
43 <#list subCategoriesSearchResult.getBaseModels()?sort_by(["title"]) as subCategory>
44 <li>
45 <a data-senna-off="true" href="${url}/-/categories/${subCategory.categoryId}">${subCategory.name}</a>
46 </li>
47
48 </#list>
49 </#if>
50 <#recover>
51 </#attempt>
52 </#list>
53 </#list>
54 </#if>
55 </ul>
56 </div>
57 </div>
58 <#if urlHasCategorias?has_content>
59 <div class="col-8 col-sm-6">
60 <!--#--Pendiente de cambiar "Borrar Filtro" en función del idioma"-->
61 <a href="${url}" class="diagonal-button more-info borrar-filtro">Borrar Filtro</a>
62 </div>
63 </#if>
64
65 <style>
66 .entry-title.taglib-categorization-filter{ visibility: hidden;}
67 .entry-title.taglib-categorization-filter>em>span{visibility: visible}
68 .entry-title.taglib-categorization-filter>em>span>span.label-item.label-item-after{
69 display:none !important;
70 }
71 </style>
72
73 </div>
74 </div>
75</div>