Navegación por categorías
Navegación por categorías
Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing: ==> maxLoop [in template "90807#90841#92683" at line 24, column 27] ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #list 1..maxLoop as i [in template "90807#90841#92683" at line 24, column 17] ----
1<#assign PropsUtil = staticUtil["com.liferay.portal.kernel.util.PropsUtil"]
2 assetCategoriesCustomService = serviceLocator.findService("pa.mtl.assetcategories.customservice.api.AssetCategoriesCustomServiceApi")
3 assetCategoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
4 assetCategoryPropertyService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService")
5 SAXReaderUtil = staticUtil["com.liferay.portal.kernel.xml.SAXReaderUtil"]
6 HtmlUtil = staticUtil["com.liferay.portal.kernel.util.HtmlUtil"]
7 layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")
8 PortletURLFactoryUtil = staticUtil["com.liferay.portal.kernel.portlet.PortletURLFactoryUtil"]
9 PortletRequest = staticUtil["javax.portlet.PortletRequest"]
10 journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
11 ParamUtil = staticUtil["com.liferay.portal.kernel.util.ParamUtil"]
12 categoryId =ParamUtil.getLong(renderRequest,"categoryId", 0)
13
14/>
15
16
17<#-- inicialización de categoría: si no hay seleccionada se coge la primera de la jerarquía -->
18<#if (categoryId <= 0) >
19
20 <#if entries?has_content>
21 <#foreach vocabulary in entries>
22
23 <#foreach aCategory in vocabulary.getCategories()>
24 <#list 1..maxLoop as i>
25 <#if aCategory.getParentCategory()?has_content>
26 <#assign aCategory = aCategory.getParentCategory()/>
27 <#else>
28 <#assign categoryId = aCategory.getCategoryId()/>
29 <#break>
30 </#if>
31 </#list>
32 </#foreach>
33
34 </#foreach>
35 </#if>
36
37</#if>
38
39<#assign currentCategory = assetCategoryService.getAssetCategory(categoryId)
40 childCategories = assetCategoriesCustomService.getChildCategoriesOrdered(categoryId,locale)
41 showContents = true
42 forceShowCategories = false
43/>
44
45<!-- Pintar subcategorías -->
46<#if childCategories?has_content>
47 <div class="card flex-md-row mb-4 box-shadow h-md-250">
48 <div class="card-body d-flex flex-column align-items-start">
49 <h2 class="mb-0">${currentCategory.getTitle(locale)}</h2>
50 <div class="outer">
51 <div class="row">
52 <#list childCategories as childCategory>
53 <#if assetCategoryPropertyService.getCategoryProperty(childCategory.getCategoryId(),"idContenido") ? has_content >
54 <#assign contentIdProperty = assetCategoryPropertyService.getCategoryProperty(childCategory.getCategoryId(),"idContenido")/>
55 <#assign contentId = contentIdProperty.getValue()/>
56 <#if contentId ? has_content>
57 <#assign journalArticleSub = journalArticleService.getLatestArticle(groupId,contentId)/>
58
59 <#assign document = SAXReaderUtil.read(journalArticleSub.getContentByLocale(locale))
60 paginaDetalleNode = document.selectSingleNode("/root/dynamic-element[@name='paginaDetalle']/dynamic-content")
61 />
62
63 <#if paginaDetalleNode?has_content && paginaDetalleNode.getText()?has_content>
64 <#assign pageDetail = paginaDetalleNode.getText()/>
65 <#if (pageDetail?index_of("@")>0)>
66 <#assign pageDetailPosition = (pageDetail?index_of("@")-1)
67 pageDetail = pageDetail[0..pageDetailPosition]
68 layoutDetail = layoutLocalService.getLayout(themeDisplay.getScopeGroupId(),false,pageDetail?number)
69 />
70 </#if>
71 <#else>
72 <#assign detailPage = "general"
73 layoutDetail = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+detailPage) />
74 </#if>
75
76 <#assign categoryUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutDetail.getPlid(), PortletRequest.RENDER_PHASE)/>
77 ${categoryUrl.setParameter("categoryId", childCategory.getCategoryId()+"")}
78
79 <#if journalArticleSub?has_content>
80 <#-- obtener el contenido de la categoría actual -->
81 <#assign childCategoryContent = journalArticleService.getArticleContent(journalArticleSub, "","VIEW", locale, themeDisplay)/>
82
83 <div class="col-md-6 ${childCategory?item_parity}">
84 ${childCategoryContent}
85
86 <div class="link-more">
87 <a class="more-information" title="${languageUtil.get(locale,'memoria.digital.general.more-info-about')} ${childCategory.getTitle(locale)}"
88 href="/${PropsUtil.get("memoria.digital.title.secciones")}?p_r_p_categoryId=${childCategory.getCategoryId()}&p_r_p_title=${journalArticleSub.getTitle(locale)}" >${languageUtil.get(locale,'memoria.digital.general.more-info')}</a>
89 </div>
90 </div>
91 </#if>
92 </#if>
93 </#if>
94 </#list>
95
96 <!-- Después de pintar las subcategorías, pintamos los contenidos relacionados con la categoría actual -->
97 <#assign journalArticles = assetCategoriesCustomService.findJournalArticlesByCategoryId(currentCategory.getCategoryId(), groupId, 0, null, "title", "asc", null, null)/>
98
99 <#list journalArticles as journalArticle>
100 <#assign document = SAXReaderUtil.read(journalArticle.getContentByLocale(locale))
101 titleNode = document.selectSingleNode("/root/dynamic-element[@name='titulo']/dynamic-content")
102 title = titleNode.getText()
103 resumenNode = document.selectSingleNode("/root/dynamic-element[@name='resumen']/dynamic-content")
104 resumen = HtmlUtil.stripHtml(resumenNode.getText())
105 imagenNode = document.selectSingleNode("/root/dynamic-element[@name='imagen']/dynamic-content")
106 currentUrl = renderResponse.createRenderURL()
107 detailPage = "detalle"
108 layoutDetail = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+detailPage)
109 detailUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutDetail.getPlid(), PortletRequest.RENDER_PHASE)
110 />
111
112 ${currentUrl.setParameter("categoryId",categoryId+"")}
113 ${detailUrl.setParameter("categoryId",currentCategory.getCategoryId()+"")}
114 ${detailUrl.setParameter("articleId", journalArticle.getArticleId())}
115
116 <div class="col-md-6 ${journalArticle?item_parity}">
117 <h3 class="title">
118 <a title="${languageUtil.get(locale,'memoria.digital.general.more-info-about')} ${title}"
119 href="${detailUrl}&articleId=${journalArticle.getArticleId()}&title=${HtmlUtil.escapeURL(title)}&redirect=${HtmlUtil.escapeURL(currentUrl)}">${title}</a>
120 </h3>
121 <div class="col-content">
122 <#if imagenNode ? has_content && imagenNode.getText() ? has_content>
123 <div class="col-icon">
124 <img src="${imagenNode.getText()}" alt="${languageUtil.get(locale,'memoria.digital.category.imagen')} - ${title}" />
125 </div>
126 <div class="col-summary">
127 <#else>
128 <div class="col-summary without-icon">
129 </#if>
130
131 ${resumen}
132 </div>
133 </div>
134 <div class="link-more">
135 <a class="more-information" title="${languageUtil.get(locale,'memoria.digital.general.more-info-about')} ${title}"
136 href="${detailUrl}&articleId=${journalArticle.getArticleId()}&title=${HtmlUtil.escapeURL(title)}&redirect=${HtmlUtil.escapeURL(currentUrl)}">${languageUtil.get(locale,'memoria.digital.general.more-info')}</a>
137 </div>
138 </div>
139 </#list>
140 </div> <!-- row -->
141 </div> <!-- outer -->
142 </div>
143 </div>
144<!-- No hay subcategorías, pintamos los contenidos de la categoría -->
145<#else>
146 <div class="card flex-md-row mb-4 box-shadow h-md-250">
147 <div class="card-body d-flex flex-column align-items-start detalle-seccion">
148 <h2 class="mb-0">${currentCategory.getTitle(locale)}</h2>
149 <div class="row contenido-date-nav-tabs">
150 <div class="col-md-12">
151 <div class="nav-home">
152 <ul class="nav nav-tabs">
153 <li class="nav-item"><a class="nav-link active" href="#tab1" data-toggle="tab">${languageUtil.get(locale,'memoria.digital.archivo.resultados-imagenes')} (751)</a></li>
154 <li class="nav-item"><a class="nav-link" href="#tab2" data-toggle="tab">${languageUtil.get(locale,'memoria.digital.archivo.resultados-documentos')} (0)</a></li>
155 </ul>
156 <div class="tab-content">
157 <div id="tab1" class="tab-pane active">
158 <div class="filtro-secciones">
159 <form action="#" class="form form-inline">
160 <div class="form-group filtro">
161 <label for="texto1" class="control-label">${languageUtil.get(locale,'memoria.digital.archivo.ordenar-resultados')}: </label>
162 <select name="schema2" id="schema2" class="field form-control"> <option value="todos">${languageUtil.get(locale,'memoria.digital.archivo.anio')}</option> <option value="monografia">${languageUtil.get(locale,'memoria.digital.archivo.titulo')}</option> </select>
163 </div>
164 <div class="form-group boton text-right">
165 <button type="button" class="btn btn-primary"><span>${languageUtil.get(locale,'memoria.digital.form.button.ir')}</span></button>
166 </div>
167 </form>
168 </div>
169 <div class="row col-md-12">
170 <#assign journalArticles = assetCategoriesCustomService.findJournalArticlesByCategoryId(currentCategory.getCategoryId(), groupId, 0, null, "title", "asc", null, null)/>
171 <#list journalArticles as journalArticle>
172 <#assign document = SAXReaderUtil.read(journalArticle.getContentByLocale(locale))
173 title = ""
174 anio = ""
175 currentUrl = renderResponse.createRenderURL()
176 detailPage = "detalle"
177 layoutDetail = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+detailPage)
178 detailUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutDetail.getPlid(), PortletRequest.RENDER_PHASE)
179 />
180 <#if document.selectSingleNode("/root/dynamic-element[@name='titulo']/dynamic-content") ? has_content>
181 <#assign titleNode = document.selectSingleNode("/root/dynamic-element[@name='titulo']/dynamic-content")
182 title = titleNode.getText()
183 />
184 </#if>
185 <#if document.selectSingleNode("/root/dynamic-element[@name='anio']/dynamic-content") ? has_content>
186 <#assign anioNode = document.selectSingleNode("/root/dynamic-element[@name='anio']/dynamic-content")
187 anio = anioNode.getText()
188 />
189 </#if>
190 <#if document.selectSingleNode("/root/dynamic-element[@name='archivo']/dynamic-content") ? has_content>
191 <#assign imagenNode = document.selectSingleNode("/root/dynamic-element[@name='archivo']/dynamic-content") />
192 </#if>
193
194 ${currentUrl.setParameter("categoryId",categoryId+"")}
195 ${detailUrl.setParameter("categoryId",currentCategory.getCategoryId()+"")}
196 ${detailUrl.setParameter("articleId", journalArticle.getArticleId())}
197
198 <div class="col-md-3 aportacion-listado">
199 <div class="col-content">
200 <#if imagenNode ? has_content && imagenNode.getText() ? has_content>
201 <div class="col-icon">
202 <a class="example-image-link" href="${imagenNode.getText()}"
203 data-lightbox="example-set" data-title="${title}">
204 <img src="${imagenNode.getText()}" alt="${languageUtil.get(locale,'memoria.digital.category.imagen')} - ${title}" />
205 </a>
206 </div>
207 </#if>
208 <h4 class="title">
209 <a title="${languageUtil.get(locale,'memoria.digital.general.more-info-about')} ${title}"
210 href="${detailUrl}&articleId=${journalArticle.getArticleId()}&title=${HtmlUtil.escapeURL(title)}&redirect=${HtmlUtil.escapeURL(currentUrl)}">${title}</a>
211 </h4>
212
213 <p class="fecha">${anio}</p>
214
215 </div>
216 </div>
217 </#list>
218 </div><!-- row col-md-12 -->
219
220 </div><!-- tab1 -->
221
222 <div id="tab2" class="tab-pane">
223 <p>${languageUtil.get(locale,'memoria.digital.archivo.resultados-no-encontrados')}. </p>
224 </div>
225 </div><!-- tab-content -->
226 </div><!-- nav-home -->
227 </div><!-- col-md-12 -->
228 </div> <!-- row contenido-date-nav-tabs-->
229 </div><!-- card-body -->
230 </div><!-- card -->
231</#if>