¿Quieres ser parte de la familia Nuestro Tiempo?
The following has evaluated to null or missing:
==> categorySearch [in template "10136#10174#53980896" at line 104, column 38]
----
Tip: If the failing expression is known to 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: #if categorySearch == category.getTit... [in template "10136#10174#53980896" at line 104, column 33]
----
1<#-- Obtener los servicios necesarios -->
2<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
3<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
4<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") />
5<#assign assetDisplayPageFriendlyURLProvider = serviceLocator.findService("com.liferay.asset.display.page.portlet.AssetDisplayPageFriendlyURLProvider") />
6<#assign ddmStructureLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMStructureLocalService") />
7
8
9<#-- Obtener el art�culo actual -->
10<#assign groupId = themeDisplay.getScopeGroupId() />
11<#assign journalArticle = journalArticleLocalService.getArticle(groupId, .vars['reserved-article-id'].data) />
12<#assign currentArticleId = .vars['reserved-article-id'].data />
13<#assign resourcePrimKey = journalArticle.getResourcePrimKey() />
14<#assign structureKey = journalArticle.getDDMStructureKey() />
15 <#assign ddmStructureId = journalArticle.getDDMStructureId() />
16
17<#-- Obtener el autor del art�culo actual -->
18<#assign aArticleXML = saxReaderUtil.read(journalArticle.getContentByLocale(locale)) />
19<#assign authorNodes = aArticleXML.selectNodes("//dynamic-element[@name='autor']/dynamic-content") />
20<#assign authorId = "" />
21<#assign authorTitle = "" />
22
23<#assign categoriesList = assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()) />
24<#assign vocabularyTopicName = "Topic" />
25
26 <#list categoriesList as category>
27 <#assign categoryVocabulary = assetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId()) />
28 <#if categoryVocabulary.getName() == vocabularyTopicName>
29 <#assign categorySearch = category.getTitle(locale)/>
30 </#if>
31 </#list>
32
33<#if authorNodes?has_content>
34 <#assign authorJson = authorNodes[0].getText()?eval />
35 <#assign authorId = authorJson.classPK />
36 <#assign authorTitle = authorJson.title />
37</#if>
38
39<#-- Buscar articulos del mismo autor y estructura -->
40<#assign relatedArticles = [] />
41<#if authorId?has_content>
42 <#if _webContentsUtil??>
43 <#assign allArticles = _webContentsUtil.getAllArticles(groupId, ddmStructureId, currentArticleId) />
44 <#else>
45 <#assign allArticles = journalArticleLocalService.getArticlesByStructureId(groupId, ddmStructureId, 0, 10, null) />
46 </#if>
47
48 <#list allArticles as article>
49 <#if article.getResourcePrimKey() != resourcePrimKey && !article.isInTrash() && article.getStatus() == 0>
50 <#assign articleXML = saxReaderUtil.read(article.getContentByLocale(locale)) />
51
52 <#assign articleAuthorNodes = articleXML.selectNodes("//dynamic-element[@name='autor']/dynamic-content") />
53 <#if articleAuthorNodes?has_content>
54 <#assign authorContentText = articleAuthorNodes[0].getText() />
55
56 <#if authorContentText?has_content && authorContentText?trim != "">
57 <#attempt>
58 <#assign articleAuthorJson = authorContentText?eval />
59
60 <#-- check if classPK property exists and matches -->
61 <#if articleAuthorJson?? && articleAuthorJson?is_hash && articleAuthorJson.classPK?? && articleAuthorJson.classPK == authorId>
62 <#assign relatedArticles = relatedArticles + [article] />
63 </#if>
64 <#recover>
65
66 </#attempt>
67 </#if>
68 </#if>
69 </#if>
70 </#list>
71
72 <#assign relatedArticles = relatedArticles?sort_by("modifiedDate")?reverse />
73 <#if relatedArticles?size gt 5>
74 <#assign relatedArticles = relatedArticles[0..4] />
75 </#if>
76</#if>
77
78<#if relatedArticles?has_content>
79 <div class="container">
80 <div class="row">
81 <#list relatedArticles as curArticle>
82 <#-- Manejo de error para obtener la URL del art�culo -->
83 <#assign viewURL = curArticle.getUrlTitle() />
84 <#if !viewURL?has_content>
85 <#assign viewURL = "/" />
86 </#if>
87
88 <#assign curArticleXML = saxReaderUtil.read(curArticle.getContentByLocale(locale)) />
89 <#assign title = curArticle.getTitle(locale) />
90 <#assign tituloDestacado = curArticleXML.valueOf("//dynamic-element[@name='tituloDestacado']/dynamic-content") />
91 <#assign imagenArticulo = curArticleXML.valueOf("//dynamic-element[@name='imagen']/dynamic-content/text()") />
92 <#assign detalle = curArticleXML.valueOf("//dynamic-element[@name='detalle']/dynamic-content") />
93 <#-- Featured Image of the Article -->
94 <#assign featuredImage = curArticle.getArticleImageURL(themeDisplay)!""/>
95
96 <#assign categoriesList = assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", curArticle.getResourcePrimKey())/>
97 <#assign vocabularyTemaName = "Tema" />
98 <#assign vocabularyNRevistaName = "N� de revista" />
99
100 <#if categoriesList?has_content>
101 <#list categoriesList as category>
102 <#assign categoryVocabulary = assetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId()) />
103 <#if categoryVocabulary.getName() == vocabularyTopicName>
104 <#if categorySearch == category.getTitle(locale)>
105 <div class="col-md">
106 <article class="article article-review">
107 <figure class="media">
108 <picture>
109 <#-- show featuredImage if set. -->
110 <#if featuredImage?has_content>
111 <img src="${featuredImage}" />
112 <#else>
113 <#if imagenArticulo?? && imagenArticulo?has_content>
114 <#attempt>
115 <#assign jsonObject = imagenArticulo?eval/>
116 <#assign entryUuid = jsonObject.uuid />
117 <#assign entryGroupId = getterUtil.getLong(jsonObject.groupId) />
118 <#assign entryAlt = jsonObject.alt />
119 <#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") />
120 <#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")>
121 <#assign dlFileEntry = dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(entryUuid, entryGroupId) />
122 <#assign assetEntry = assetEntryLocalService.getEntry("com.liferay.document.library.kernel.model.DLFileEntry", dlFileEntry.fileEntryId) />
123 <#assign assetRenderer = assetEntry.assetRenderer />
124 <#assign imagen = assetRenderer.getURLDownload(themeDisplay) />
125 <img alt="${entryAlt}" data-fileentryid="${dlFileEntry.fileEntryId}" src="${imagen}" />
126 <#recover>
127 </#attempt>
128 </#if>
129 </#if>
130 </picture>
131 </figure>
132
133 <p class="author">
134 <a title=${authorTitle}>${authorTitle}</a>
135 </p>
136
137 <#-- No es necesario para rese�as
138 <p class="kicker">
139 <#if categoriesList?has_content>
140 <#list categoriesList as category>
141 <#assign categoryVocabulary = assetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId()) />
142 <#if categoryVocabulary.getName() == vocabularyTemaName || categoryVocabulary.getName() == vocabularyNRevistaName>
143 <a title="${category.getTitle(locale)}">${category.getTitle(locale)}</a>
144 </#if>
145 </#list>
146 </#if>
147 </p>
148 -->
149
150 <h2 class="title title-standard">
151 <a href="${viewURL}" title="${title}">${title}</a>
152 </h2>
153
154 <#-- No es necesario para rese�as
155 <p class="meta">
156 <#assign fecha = dateUtil.getDate(curArticle.getDisplayDate(), "d 'de' MMMM 'de' yyyy", locale) />
157 <#if fecha?has_content>
158 <span>${fecha}</span>
159 </#if>
160
161 <#assign tiempo = "" />
162 <#if detalle?has_content>
163 <#assign content = detalle?trim />
164 <#if content != "">
165 <#assign contentCount = content?replace("<[^>]+>", "", "r")?word_list?size />
166 <#if contentCount gt 0>
167 <#assign minutesValue = (contentCount/200)?round />
168 <#if minutesValue == 0>
169 <#assign tiempo = "Unos segundos" />
170 <#elseif minutesValue == 1>
171 <#assign tiempo = minutesValue + " minuto" />
172 <#else>
173 <#assign tiempo = minutesValue + " minutos" />
174 </#if>
175 </#if>
176 </#if>
177 </#if>
178 <#if tiempo?? && tiempo != "">
179 <span><i class="fa fa-regular fa-clock"></i> ${tiempo}</span>
180 </#if>
181 </p>
182 -->
183
184
185 </article>
186 </div>
187 </#if>
188 </#if>
189
190 </#list>
191 </#if>
192
193
194 </#list>
195 </div>
196 </div>
197<#else>
198 <#-- No se encontraron relacionados -->
199 <div class="text"><p>No se han encontrado articulos relacionados</p></div>
200</#if>
201
202<style>
203/* default image size TODO: fix in theme, this is a temporal workaround. */
204.nuestro-tiempo .article.article-review .media{
205 height: initial;
206}
207</style>
Siempre estamos buscando buenos colaboradores para la revista. Si tienes una buena historia, queremos escucharte.