Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing: ==> request.getParameter("articulo") [in template "20096#20122#7614223" at line 109, column 25] ---- 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: #assign myParamValue = request.getPar... [in template "20096#20122#7614223" at line 109, column 1] ----
1<style>
2 .aecid-detalle a {
3 color: var(--brand-color-1);
4 }
5
6 .aecid-detalle a:hover,
7 .aecid-detalle .share-option:hover {
8 opacity: .5;
9 }
10
11 .aecid-detalle h2 {
12 color: var(--brand-color-1);
13 margin-bottom: 20px;
14 font-size: 24px;
15 }
16
17 .separador {
18 color: #000;
19 }
20
21 .fecha {
22 font-weight: bold;
23 }
24
25 .categoria {
26 color: #6f6f6f;
27 font-size: 0.85em;
28 text-transform: uppercase;
29 }
30
31 .resumen {
32 color: #6f6f6f;
33 font-size: 0.9em;
34 }
35
36 .aecid-detalle iframe {
37 width: 100%;
38 height: 30em;
39 }
40
41 .contenido {
42 font-family: Barlow;
43 }
44
45 .contenido img {
46 margin-left: 0 !important;
47 max-width: 100% !important;
48 height: auto;
49 }
50
51 .pieFoto {
52 font-size: 14px;
53 }
54
55 .botonRRSS {
56 display: inline-block;
57 color: #fff;
58 vertical-align: middle;
59 cursor: pointer;
60 -webkit-user-select: none;
61 -moz-user-select: none;
62 user-select: none;
63 background-color: transparent;
64 border: 1px solid transparent;
65 padding: 0.375rem 0.75rem;
66 border-radius: 0.25rem;
67 transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
68 }
69
70 .share-option {
71 background-color: transparent;
72 border: none;
73 padding: 0;
74 }
75
76 .facebook {
77 background-color: #3B5998;
78 }
79
80 .fb-xfbml-parse-ignore {
81 background-color: transparent;
82 border: none;
83 }
84
85 .fb-xfbml-parse-ignore:hover {
86 opacity: .5;
87 }
88
89 .twitter {
90 background-color: #1D9BF0;
91 }
92
93 .mainImg {
94 max-height: 21rem;
95 object-fit: cover;
96 width: auto;
97 max-width: 100%;
98 }
99
100 @media screen and (max-width: 576px) {
101 .aecid-noticia {
102 padding-left: 10px;
103 padding-right: 10px;
104 }
105 }
106</style>
107
108
109<#assign myParamValue = request.getParameter("articulo")>
110<#assign grupostr = request.getParameter("sitio")>
111<#assign grupolong = grupostr?number >
112
113<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
114<#assign journalArticleResourceLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService") />
115<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
116<#assign articleId = request.getParameter("articulo")>
117<#assign article = journalArticleLocalService.getArticle(grupolong, articleId)>
118<#assign articleResource = journalArticleResourceLocalService.getArticleResource(article.getResourcePrimKey())>
119<#assign articleResourcePK = articleResource.getPrimaryKey()>
120<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")>
121<#assign assetCategoryPropertyLocalService = serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService")>
122<#assign assetEntry = assetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle", articleResourcePK) />
123<#assign assetEntryId = assetEntry.getEntryId() />
124
125<!-- Funciones -->
126<#function getJournalArticleRootElement journal>
127 <#attempt>
128 <#if journal?has_content>
129 <#local journalLocaleContent = journal.getContentByLocale(locale.toString()) />
130 <#local journalContentXml = saxReaderUtil.read(journalLocaleContent) />
131 <#local rootElementContent = journalContentXml.getRootElement() />
132 <#if rootElementContent?? && rootElementContent?has_content>
133 <#return rootElementContent />
134 </#if>
135 </#if>
136 <#recover >
137 </#attempt>
138 <#return "" />
139</#function>
140
141<#function getXmlTextElement rootElementContent fieldReference>
142 <#attempt>
143 <#local xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='" + fieldReference + "']") />
144 <#local element = xPathSelector.selectSingleNode(rootElementContent) />
145 <#return element.getStringValue()?trim />
146 <#recover >
147 </#attempt>
148 <#return "" />
149</#function>
150
151<#function getXmlTextElement rootElementContent fieldReference>
152 <#attempt>
153 <#local xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='" + fieldReference + "']") />
154 <#local element = xPathSelector.selectSingleNode(rootElementContent) />
155 <#return element.getStringValue()?trim />
156 <#recover >
157 </#attempt>
158 <#return "" />
159</#function>
160
161<#function getJournalArticle resourcePrimKey>
162 <#attempt>
163 <#local journal = journalArticleLocalService.getLatestArticle(resourcePrimKey, 0) />
164 <#return journal />
165 <#recover >
166 </#attempt>
167 <#return "" />
168</#function>
169
170<#function getJournalArticleByJsonElement elementJson>
171 <#attempt>
172 <#local resourcePrimKey = elementJson.classPK?number />
173 <#local journal = getJournalArticle(resourcePrimKey) />
174 <#return journal />
175 <#recover >
176 </#attempt>
177 <#return "" />
178</#function>
179
180<#function obtenerCamposRepetidos documentRoot fieldReference >
181 <#return documentRoot.selectNodes("dynamic-element[@field-reference='" + fieldReference + "']")/>
182</#function>
183
184<#function getFriendlyUrlJournal journal>
185 <#return "/-/" + journal.getUrlTitle() />
186</#function>
187
188<#function removeUrlParams url>
189 <#if url?contains("?") >
190 <#return url?substring(0, url?index_of("?")) />
191 </#if>
192 <#return url/>
193</#function>
194
195<#macro fechaPublicacionJournal pattern="MMMM '|' dd '|' yyyy" upperCase=true>
196 <#local date = getJournalArticleDisplayDate(article) />
197 <#if date?has_content>
198 <#local dateFormat = formatDate(date, pattern) />
199 ${upperCase?then(dateFormat?upper_case, dateFormat)}
200 </#if>
201</#macro>
202
203<#function getJournalArticleDisplayDate articulo>
204 <#local journalArticleDisplayDateF = "">
205 <#attempt>
206 <#local journalArticleDisplayDate = articulo.getDisplayDate() />
207 <#if journalArticleDisplayDate?has_content>
208 <#local journalArticleDisplayDateF = journalArticleDisplayDate />
209 <#local date = dateUtil.parseDate("EEE, dd MMM yyyy HH:mm:ss Z", journalArticleDisplayDate, localeUtil.getDefault()) />
210 <#local journalArticleDisplayDateF = date />
211 </#if>
212 <#recover>
213 </#attempt>
214 <#return journalArticleDisplayDateF />
215</#function>
216
217<#function formatDate date datePattern="EEEE, dd MMMM yyyy HH:mm">
218 <#attempt>
219 <#local timeZoneMadrid = timeZoneUtil.getTimeZone("Europe/Madrid") />
220 <#local dateFormat = dateUtil.getDate(date, datePattern, locale, timeZoneMadrid) />
221 <#return dateFormat />
222 <#recover>
223 </#attempt>
224 <#return "" />
225</#function>
226
227<#assign currentURL=themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() />
228<#if (serviceLocator.findService("es.aecid.shorturl.service.AecidShortUrlService"))??>
229 <#assign shortUrlService=serviceLocator.findService("es.aecid.shorturl.service.AecidShortUrlService") />
230 <#assign currentShortURL=themeDisplay.getPortalURL() + '/' + shortUrlService.getShortUrl(currentURL, companyId, groupId, themeDisplay.getUserId()) />
231<#else>
232 <#assign currentShortURL=currentURL />
233</#if>
234
235<!-- obtener los datos de los campos -->
236<#assign journalRootElement = getJournalArticleRootElement(article) />
237<#assign contenido = article.getContent() />
238
239<#if journalRootElement?has_content>
240 <#assign video = getXmlTextElement(journalRootElement, "video") />
241 <#assign Resumen = getXmlTextElement(journalRootElement, "resumen") />
242 <#assign Imagen = getXmlTextElement(journalRootElement, "image") />
243 <#assign Contenido = getXmlTextElement(journalRootElement, "content") />
244</#if>
245
246<#assign redirectUrl = paramUtil.getString(request, "redirect", "") />
247<a class="back-button" href="${redirectUrl}">
248 <img src="${themeDisplay.getPathThemeImages()}/abajo.svg" alt="">
249 <span>Atrás</span>
250</a>
251
252<div id="aecid-detalle-noticia" class="container p-0 aecid-detalle mt-5 mb-5">
253 <div class="row aecid-noticia px-3 px-md-0">
254 <div class="col-lg-6 col-12 row px-0">
255 <#assign jsonFactory = serviceLocator.findService("com.liferay.portal.kernel.json.JSONFactory")>
256 <#assign jsonObject = jsonFactory.createJSONObject(Imagen)>
257 <#assign urlImagen = jsonObject.getString("url")>
258 <#assign urlImagenAlt = jsonObject.getString("alt")>
259
260 <#assign ImagenRedes = "/documents/d/global/noticias-convocatoria">
261 <#if (video?has_content)>
262 <div class="col-12 p-0">
263 <div class="row justify-content-center">
264 <div class="col-12 p-0">
265 <#if video?contains("www.youtube.com/embed/")>
266 <iframe
267 title="Reproductor de vídeo YouTube" src="${video}" frameborder="0"
268 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
269 allowfullscreen>
270 </iframe>
271
272 <#elseif video?contains("www.youtube.com/") && video?split("/")?size gte 2>
273 <#assign enlaceIframe = "" >
274 <#if video?contains("watch")>
275 <#assign enlaceIframe = video?split("/")[3]?split("watch?v=")[1] >
276 <#else>
277 <#assign enlaceIframe = video?split("/")[3]>
278 </#if>
279 <iframe title="Reproductor de vídeo YouTube"
280 src="https://www.youtube.com/embed/${enlaceIframe}"
281 frameborder="0"
282 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
283 allowfullscreen>
284 </iframe>
285
286 <#elseif video?contains("youtu.be")>
287 <a href="${friendlyURLs[themeDisplay.getLanguageId()]!""}" title="${languageUtil.get(locale, "lleva.a.pagina")} ${article.getTitle(locale)?truncate(100, '...')}">
288 <iframe tabindex="0" height="210px" title="Reproductor de vídeo YouTube"
289 src="https://www.youtube.com/embed/${video?split("/")[3]}?showinfo=0"
290 frameborder="0"
291 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
292 allowfullscreen>
293 </iframe>
294 </a>
295
296 <#elseif video?contains("vimeo") && video?split("/")?size gte 2>
297 <iframe title="Reproductor de vídeo Vimeo"
298 src="https://player.vimeo.com/video/${video?split("/")[3]}?"
299 frameborder="0" allow="autoplay; fullscreen; picture-in-picture"
300 allowfullscreen>
301 </iframe>
302 </#if> <!-- Asegura que este cierre esté presente -->
303 </div>
304 </div>
305 </div>
306 <#else>
307 <#assign jsonFactory = serviceLocator.findService("com.liferay.portal.kernel.json.JSONFactory")>
308 <#assign jsonObject = jsonFactory.createJSONObject(Imagen)>
309 <#assign urlImagen = jsonObject.getString("url")>
310 <#assign urlImagenAlt = jsonObject.getString("alt")>
311 <div class="col-12 p-0">
312 <#if urlImagen?has_content>
313 <img alt="${urlImagenAlt}" src="${urlImagen}" class="mainImg w-100" />
314 <p class="pieFoto"><em tabindex="0"><span class="sr-only">${languageUtil.get(locale, "pie.de.foto")}: </span>
315 ${urlImagenAlt}
316 </em></p>
317 <#assign ImagenRedes = jsonObject.getString("url")>
318 <#else>
319 <img alt="Logo de AECID" src="/documents/d/global/noticias-convocatoria" class="mainImg w-100" />
320 <#assign ImagenRedes = "/documents/d/global/noticias-convocatoria">
321 </#if>
322 </div>
323 </#if>
324 </div>
325 <div class="col-lg-6 col-12 pl-lg-5 px-0 flex-column justify-content-center">
326 <div class="p-0">
327 <h2 tabindex="0">${article.getTitle(locale)}</h2>
328 </div>
329 <div class="p-0">
330 <p class="fecha" tabindex="0"><@fechaPublicacionJournal pattern="dd/MM/yyyy - HH:mm" upperCase=false/></p>
331 </div>
332 <div class="p-0">
333 <p tabindex="0"><span class="sr-only">${languageUtil.get(locale, "categorias.de.la.noticia")}</span>
334 <span class="categoria">
335 <#if categories?has_content>
336 <#list categories as category>
337 <#assign
338 numIdCategoria=category.getTreePath()?substring(category.getTreePath()?last_index_of("/")
339 - 5 , category.getTreePath()?length - 1) />
340 <span>${category.getName()}</span>
341 <span class="separador">
342 ${category?has_next?then(' | ', '')}
343 </span>
344 </#list>
345 </#if>
346 </span>
347 </p>
348 </div>
349 <div class="p-0">
350 <p class="resumen" tabindex="0"><span class="sr-only"> ${languageUtil.get(locale, "resumen.de.la.noticia")} </span>
351 <#if Resumen??>
352 ${Resumen}
353 </#if>
354 </p>
355 </div>
356 </div>
357 <div class="col-12 p-0">
358 <hr />
359 </div>
360 <div class="col-lg-10 col-12 p-0 ">
361 <div class="contenido" tabindex="0"><span class="sr-only">${languageUtil.get(locale, "contenido.de.la.noticia")} </span>
362 <#if Contenido??>
363 ${Contenido}
364 </#if>
365 </div>
366 </div>
367 <div class="col-2 d-lg-block d-none"></div>
368 <@liferay_util["html-top"]
369 outputKey="htmltop">
370 <!-- METAS RRSS -->
371 <meta property="og:url" content="${currentShortURL}" />
372 <meta property="og:site_name" content="SiteName" />
373 <meta property="og:type" content="website" />
374 <meta property="og:locale" content="gl_ES" />
375 <meta property="og:locale:alternate" content="gl_ES" />
376 <meta name="twitter:card" content="summary_large_image" />
377 <meta property="og:title" content="${article.getTitle(locale)}" />
378 <meta name="twitter:title" content="${article.getTitle(locale)}" />
379
380 <#if Resumen != "">
381 <meta property="og:description" content="${htmlUtil.stripHtml(Resumen)?replace("\"", "'" )}" />
382 <meta name="twitter:description" content="${htmlUtil.stripHtml(Resumen)?replace("\"", "'" )}" />
383 <#else>
384 <meta property="og:description" content="${article.getTitle(locale)}" />
385 <meta name="twitter:description" content="${article.getTitle(locale)}" />
386 </#if>
387
388 <meta property="og:image" content="${themeDisplay.getPortalURL()+ImagenRedes}" />
389 <meta property="og:image:secure_url" content="${themeDisplay.getPortalURL()+ImagenRedes}" />
390 <meta name="twitter:image" content="${themeDisplay.getPortalURL()+ImagenRedes}" />
391 <meta property="og:image:alt" content="Alt img og" />
392 <meta property="fb:app_id" content="???">
393 <meta property="fb:admins" content="https://www.facebook.com/Aecid.es">
394 <meta name="twitter:domain" content="${currentShortURL}" />
395 <meta name="twitter:site" content="@AECID_es" />
396 </@>
397 <div class="row col-12 p-0">
398 <!-- button visible facebook -->
399 <div class="col-flex mr-2">
400 <button class="fb-xfbml-parse-ignore" onClick="shareFacebook();" target="_blank" class="share-option"
401 index-social-media-list="0">
402 <div class="botonRRSS facebook">
403 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
404 class="bi bi-facebook" viewBox="0 0 16 16">
405 <path
406 d="M16 8.049c0-4.446-3.582-8.05-8-8.05C3.58 0-.002 3.603-.002 8.05c0 4.017 2.926 7.347 6.75 7.951v-5.625h-2.03V8.05H6.75V6.275c0-2.017 1.195-3.131 3.022-3.131.876 0 1.791.157 1.791.157v1.98h-1.009c-.993 0-1.303.621-1.303 1.258v1.51h2.218l-.354 2.326H9.25V16c3.824-.604 6.75-3.934 6.75-7.951z" />
407 </svg>
408 </div>
409 </button>
410 </div>
411 <!-- button visible twitter -->
412 <div class="col-flex mr-2">
413 <a href="https://twitter.com/intent/tweet?text=Mira esta noticia: ${article.getTitle(locale)} ${currentShortURL}"
414 class="twitter-share share-option no-ico" target="_blank" index-social-media-list="1">
415 <div class="botonRRSS twitter">
416 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
417 class="bi bi-twitter" viewBox="0 0 16 16">
418 <path
419 d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z" />
420 </svg>
421 </div>
422 </a>
423 </div>
424 </div>
425 </div>
426</div>
427
428
429<script>
430 function shareFacebook() {
431 let urlShare = 'http://www.facebook.com/sharer.php?s=100&p[title] = ' + encodeURI('${article.getTitle(locale)} ') + '&p[summary] = Resumen & p[url] = ${currentShortURL} ';
432 let a = document.createElement('a');
433 a.target = '_blank';
434 a.href = urlShare;
435 a.click();
436 }
437</script>