S'ha produït un error mentre es processava la plantilla.
The following has evaluated to null or missing:
==> SepGaleria.ImagenGaleria  [in template "20097#20123#MISSM-NOTICIA-COMUNICACION-TEMPLATE" at line 226, column 40]

----
Tip: It's the step after the last dot that caused this error, not those before it.
----
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 SepGaleria?has_content && SepGale...  [in template "20097#20123#MISSM-NOTICIA-COMUNICACION-TEMPLATE" in macro "showImage" at line 226, column 9]
	- Reached through: @showImage  [in template "20097#20123#MISSM-NOTICIA-COMUNICACION-TEMPLATE" at line 94, column 25]
----
1<#assign customDocSizeUtil = serviceLocator.findService("es.gob.inclusion.base.util.CustomDocSizeUtil")>
 
2<#assign currentURL = portalUtil.getCurrentCompleteURL(request)/>
 
3<#assign viewURL = friendlyURLs[themeDisplay.getLanguageId()]!friendlyURLs['es_ES']!""/>
 
4<#assign articleTitle= .vars['reserved-article-title'].data>
 
5<#assign articleId = .vars['reserved-article-id'].data />
 
6<#assign displaydate = .vars['reserved-article-display-date'].data>
 
7<#-- Save the original page locale for later -->
 
8<#assign originalLocale = .locale>
 
9<#-- Set the page locale to the portals default locale -->
 
10<#setting locale = localeUtil.getDefault()>
 
11<#assign displaydate = displaydate?datetime("EEE, d MMM yyyy HH:mm:ss Z")>
 
12<#-- Set the page locale back to the original page locale -->
 
13<#assign locale = originalLocale>
 
14<#assign journalResourceService = serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")/>
 
15<#assign assetCategoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryService")/>
 
16<#assign classPK = journalResourceService.getArticleResourcePrimKey(groupId, articleId) />
 
17<#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")/>
 
18<#assign actualJournalArticle = journalArticleService.fetchArticle(groupId,articleId)>
 
19<#assign categorias = assetCategoryService.getCategories("com.liferay.journal.model.JournalArticle", classPK) />
 
20
 
21
 
22<div class="m-noticiaDetail m-genericContent__wrapper">
 
23	<div class="container">
 
24		<!--CATEGORÍAS y FECHA-->
 
25		<div class="m-noticiaDetail__tagDate">
 
26			<div>	
 
27				<p class="m-noticiaDetail__date">${displaydate?string["dd/MM/yyyy"]}</p>
 
28			</div>
 
29		</div>
 
30	
 
31		<#if (Antetitulo.getData())?? && Antetitulo.getData() != "">
 
32		<div class="m-noticiaDetail__wrapperAntetitulo">	
 
33			<p class="m-noticiaDetail__antetitulo">${Antetitulo.getData()}</p>
 
34		</div>
 
35		</#if>
 
36			
 
37		
 
38		<#--  CABECERA  -->
 
39		<#if (articleTitle)?? && articleTitle != "">
 
40			<div class="m-noticiaDetail__titleWrapper">
 
41				<h2 class="m-noticiaDetail__title">${articleTitle}</h2>
 
42			</div>
 
43		</#if>
 
44		<div class="m-noticiaDetail__tag">
 
45				<#if categorias?has_content>
 
46				<#assign hasGoodCategory = false/>
 
47					<#list categorias as category>
 
48						<#if (category.getVocabularyId() == 772210)||(category.getVocabularyId() == 1010207)>
 
49							<#assign hasGoodCategory = true/>
 
50						</#if>
 
51					</#list>
 
52					<#if (hasGoodCategory)>
 
53						<#if categorias?size == 1>
 
54							<p class="m-noticiaDetail__tagP"><@liferay.language key="es.gob.inclusion.noticias-tema"/>: </p>
 
55						<#elseif categorias?size gt 1 >
 
56							<p class="m-noticiaDetail__tagP"><@liferay.language key="es.gob.inclusion.noticias-temas"/>: </p>
 
57						</#if>
 
58						<ul class="m-categoriesList m-listNocenter">
 
59					</#if>
 
60					<#list categorias as category>
 
61						<#if (category.getVocabularyId() == 772210)||(category.getVocabularyId() == 1010207)>
 
62							<li class="m-tags-notas-prensa">
 
63								${category.getTitle(locale)}
 
64							</li>
 
65						</#if>
 
66					</#list>
 
67					</ul>
 
68				</#if>
 
69			</div>
 
70
 
71			<!-- COMPARTIR -->
 
72
 
73<#assign currentURL = portalUtil.getCurrentURL(request)
 
74
 
75	titulo = articleTitle?truncate(30)
 
76	currentUrl = currentURL
 
77	textoCola = " a través de @inclusiongob"
 
78	urlTwitter = "https://twitter.com/intent/tweet?text="
 
79	facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='
 
80	urlLinkedin = "https://www.linkedin.com/shareArticle?mini=true&url="
 
81	urlWhatsapp = "whatsapp://send?text="
 
82	serverName = '10.118.70.1'
 
83	url = "https://"+serverName
 
84	url=url+currentUrl
 
85	urlFinalTwitter=urlTwitter+titulo+' '+url+textoCola
 
86	urlFinalFacebook=facebookURL+url+'&scrape=true'
 
87	urlFinalLinkedin=urlLinkedin+url+'&title='+titulo+'&source=LinkedIn'
 
88	urlFinalWhatsapp=urlWhatsapp+titulo+': '+viewURL
 
89	/>
 
90
 
91
 
92		<#--  IMAGEN PRINCIPAL  -->
 
93		<div class="m-noticiaDetail__imgRRSS">
 
94			<@showImage/>
 
95			<div class="m-noticiaDetail__sumaryRRSS">
 
96				<#if (Sumario.getData())?? && Sumario.getData() != "">
 
97					<div class="m-noticiaDetail__sumary">
 
98					${Sumario.getData()}
 
99					</div>
 
100				</#if>
 
101				<div class="m-logos-rrss">
 
102					<p class="m-noticiaDetail__p"><@liferay.language key="es.gob.inclusion.noticias.comparte-redes-sociales"/>: </p>
 
103					<ul class="m-listBase ">
 
104						<li>
 
105							<a class="m-logos-rrss__item icon-x-twitter icon-2x" id="twitter-nota-prensa" href="${urlFinalTwitter}" target="_blank">
 
106								<span class="sr-only"><@liferay.language key="es.gob.inclusion.noticias.compartir-en-Twitter"/></span> 
 
107							</a>
 
108						</li>
 
109						<li>
 
110							<a class="m-logos-rrss__item icon-facebook icon-2x" id="facebook-nota-prensa" href="${urlFinalFacebook}" target="_blank"> 
 
111								<span class="sr-only"><@liferay.language key="es.gob.inclusion.noticias.compartir-en-Facebook"/></span> 
 
112							</a>
 
113						</li>
 
114						<li>
 
115							<a class="m-logos-rrss__item icon-linkedin icon-2x" id="linkedin-nota-prensa" href="${urlFinalLinkedin}" target="_blank"> 
 
116								<span class="sr-only"><@liferay.language key="es.gob.inclusion.noticias.compartir-en-Linkedin"/></span> 
 
117							</a>
 
118						</li>
 
119						<li>
 
120							<a class="m-logos-rrss__item icon-whatsapp icon-2x" id="whatsapp-nota-prensa" href="${urlFinalWhatsapp}" target="_blank"> 
 
121								<span class="sr-only"><@liferay.language key="es.gob.inclusion.noticias.compartir-en-Whatsapp"/></span> 
 
122							</a>
 
123						</li>
 
124					</ul>
 
125				</div>
 
126			</div>
 
127		</div>
 
128		
 
129
 
130		
 
131
 
132			
 
133		<#--  INFO  -->
 
134	
 
135			
 
136			<#if (Contenido.getData())?? && Contenido.getData() != "">
 
137				<div class="m-noticiaDetail__content">
 
138					${Contenido.getData()?replace("https://prensa.inclusion.gob.es","")}
 
139				</div>	
 
140			</#if>
 
141		
 
142	
 
143
 
144		<#--  VIDEO   -->
 
145			<#if (UrlExterna.getData())?? && UrlExterna.getData() != "">
 
146				<div class="m-noticiaDetail__videoWrapper mt-5">
 
147			<h3><@liferay.language key="Video relacionado con la noticia"/></h3>
 
148				<div class="m-noticiaDetail__video">
 
149				
 
150					<div class="m-urlVideo" id="m-urlVideo" data-video="${UrlExterna.getData()}">
 
151						<div class="alert alert-info error-message" hidden role="alert">
 
152							<p>Please enter a valid video URL.</p>
 
153							<p>The URL can point to any video file or a Youtube video.</p>
 
154						</div>
 
155						<div aria-hidden="true" class="loading-animation"></div>
 
156						<div aria-hidden="true" class="video-container"></div>
 
157						<div aria-hidden="true" class="video-mask"></div>
 
158					</div>
 
159				</div>
 
160				</div>
 
161			</#if>
 
162	 
 
163
 
164
 
165			<!-- SLIDER IMAGENES Y VIDEOS -->
 
166
 
167
 
168
 
169	<#assign haySlider = 'false'/>
 
170	<#if SepGaleria?has_content && SepGaleria.ImagenGaleria.getSiblings()?has_content && (SepGaleria.ImagenGaleria.getData())?? && SepGaleria.ImagenGaleria.getData() != "">
 
171		<h3 class="mb-4" id="galeria"><@liferay.language key="es.gob.inclusion.noticia.detalle.seccion-galeria"/></h3>
 
172		<div class="slider-notas-prensa margin-bottom-prensa ">
 
173				<#list SepGaleria.ImagenGaleria.getSiblings() as cur_imagen>
 
174					<#if cur_imagen.getData()?? && cur_imagen.getData() != ''>
 
175						<#assign haySlider = 'true'/>
 
176						<div>
 
177							<div class="slider-notas-prensa-item" data-descarga="${cur_imagen.getData()}" style="background-image:url('${cur_imagen.getData()}');">
 
178								<img src="${cur_imagen.getData()}" alt="${cur_imagen.getAttribute('alt')}"/>
 
179							</div>
 
180						</div>
 
181					</#if>
 
182				</#list>
 
183		</div>
 
184	</#if>
 
185	<input id="haySlider" type="hidden" value="${haySlider}"/>
 
186
 
187
 
188		<#--  DOCUMENTOS  -->
 
189		
 
190			<div class="m-noticiaDetail__filesRelated m-genericContent__docLinkWrapper">
 
191				
 
192				<#if SepDocumentos?has_content && SepDocumentos.Documento.getSiblings()?has_content && (SepDocumentos.Documento.getData())?? && SepDocumentos.Documento.getData() != "">
 
193					<div class="m-noticiaDetail__files m-genericContent__docs">
 
194						<h3><@liferay.language key="es.gob.inclusion.noticias.ficheros-adjuntos"/></h3>
 
195						<ul class="">
 
196							<#list SepDocumentos.Documento.getSiblings() as cur_documento>
 
197								<li class="m-genericContent__liDoc">
 
198									<#if cur_documento.DocumentoTitAlt.getData()?? && cur_documento.DocumentoTitAlt.getData() != "">
 
199										${customDocSizeUtil.getDocSize(cur_documento.DocumentoTitAlt.getData(), cur_documento.getData(), themeDisplay)}	
 
200									<#else>
 
201										${customDocSizeUtil.getDocSize(cur_documento.getData(), themeDisplay)}
 
202									</#if>
 
203								</li>
 
204							</#list>
 
205						</ul>
 
206					</div>
 
207				</#if>
 
208				<div class="m-genericContent__links d-none">
 
209					<h3 class="m-genericContent__docs"><@liferay.language key="es.gob.inclusion.noticias.contenidos-relacionados"/></h3>
 
210					<div class="m-journal-detail__relatedAssetsDest">
 
211						<!-- EMPTY DFLT -->
 
212					</div>
 
213				
 
214
 
215				<#--  CONTENIDOS RELACIONADOS  -->
 
216				</div>
 
217			</div>	
 
218	</div>
 
219</div>
 
220
 
221<#macro showImage>
 
222	<#assign altImage= "">
 
223	<#assign firstImage = "">
 
224	<#assign externalPath = "/WebPrensaInclusion/img/noticias/principal/">
 
225
 
226	<#if SepGaleria?has_content && SepGaleria.ImagenGaleria.getSiblings()?has_content && (SepGaleria.ImagenGaleria.getData())?? && SepGaleria.ImagenGaleria.getData() != "">
 
227		<#assign backupImg=SepGaleria.ImagenGaleria.getSiblings()[0].getData()>
 
228	<#else>
 
229		<#assign backupImg=themeDisplay.getPathThemeImages() + "/default/porDefectoMinisterio.jpeg">
 
230	</#if>
 
231
 
232	<#if (ImagenPrincipal.getData())?? && ImagenPrincipal.getData() != "">
 
233		<#assign firstImage= ImagenPrincipal.getData()>
 
234		<#if (ImagenPrincipal.getData())?? && ImagenPrincipal.getData() != "">
 
235			<#assign altImage= ImagenPrincipal.getAttribute("alt")>
 
236		</#if>
 
237	<#elseif (ImagenPrincipalUrl.getData())?? && ImagenPrincipalUrl.getData() != "">
 
238		<#assign firstImage = externalPath + ImagenPrincipalUrl.getData()>
 
239		<#if (ImagenPrincipalUrl.ImagenPrincipalURLAlt.getData())?? && ImagenPrincipalUrl.ImagenPrincipalURLAlt.getData() != "">
 
240			<#assign altImage= ImagenPrincipalUrl.ImagenPrincipalURLAlt.getData()>
 
241		</#if>
 
242	<#else>
 
243		<#assign firstImage = themeDisplay.getPathThemeImages() + "/default/porDefectoMinisterio.jpeg">
 
244	</#if>
 
245
 
246	<#if (firstImage)?? && firstImage != "">
 
247		<div class="m-noticiaDetail__img" role="img" style="background-image: url('${firstImage}'), url('${backupImg}');">
 
248			<img alt="${altImage}" src="${firstImage}" />
 
249		</div>
 
250	</#if>
 
251</#macro>
 
252
 
253
 
254<script>
 
255	
 
256	$(document).ready(function () {
 
257		$('.slider-notas-prensa').slick({
 
258			slidesToShow: 1,
 
259			slidesToScroll: 1,
 
260			dots: true,
 
261			arrows: true,
 
262			infinite: true,
 
263			fade: true,
 
264			responsive: [
 
265				{
 
266				breakpoint: 1200,
 
267				settings: {
 
268					slidesToShow: 1,
 
269					slidesToScroll: 1,
 
270					arrows: true,
 
271					dots: true,
 
272				}
 
273				},
 
274				{
 
275				breakpoint: 767,
 
276				settings: {
 
277					slidesToShow: 1,
 
278					slidesToScroll: 1,
 
279					arrows: false,
 
280					dots: true
 
281				}
 
282				}
 
283			]
 
284		});
 
285
 
286		let content = null;
 
287		let videoContainer = null;
 
288		let errorMessage = null;
 
289		let loadingIndicator = null;
 
290		let videoMask = null;
 
291
 
292		const height = 315;
 
293		const width = 560;
 
294		const autoPlay = false;
 
295		const controls = true;
 
296		const loop = false;
 
297		const muted = false;
 
298
 
299		
 
300	
 
301	function resize() {
 
302		content.style.height = '';
 
303		content.style.width = '';
 
304
 
305		requestAnimationFrame(function () {
 
306			try {
 
307				const boundingClientRect = content.getBoundingClientRect();
 
308
 
309				const contentWidth = width || boundingClientRect.width;
 
310
 
311				const contentHeight = height || contentWidth * 0.5625;
 
312
 
313				content.style.height = contentHeight + 'px';
 
314				content.style.width = contentWidth + 'px';
 
315			}
 
316			catch (error) {
 
317				window.removeEventListener('resize', resize);
 
318			}
 
319		});
 
320	}
 
321
 
322	function showVideo() {
 
323		videoContainer.removeAttribute('aria-hidden');
 
324		errorMessage.parentElement.removeChild(errorMessage);
 
325		loadingIndicator.parentElement.removeChild(loadingIndicator);
 
326
 
327		if (!document.body.classList.contains('has-edit-mode-menu')) {
 
328			videoMask.parentElement.removeChild(videoMask);
 
329		}
 
330
 
331		window.addEventListener('resize', resize);
 
332
 
333		resize();
 
334	}
 
335
 
336	function showError() {
 
337		if (document.body.classList.contains('has-edit-mode-menu')) {
 
338			errorMessage.removeAttribute('hidden');
 
339			videoContainer.parentElement.removeChild(videoContainer);
 
340			loadingIndicator.parentElement.removeChild(loadingIndicator);
 
341		}
 
342		else {
 
343			fragmentElement.parentElement.removeChild(fragmentElement);
 
344		}
 
345	}
 
346
 
347	const rawProvider = {
 
348		getParameters: function (url) {
 
349			return {url: url};
 
350		},
 
351
 
352		showVideo: function (parameters) {
 
353			const video = document.createElement('video');
 
354			const source = document.createElement('source');
 
355
 
356			source.src = parameters.url;
 
357
 
358			video.autoplay = autoPlay;
 
359			video.controls = controls;
 
360			video.loop = loop;
 
361			video.muted = muted;
 
362
 
363			video.style.height = '100%';
 
364			video.style.width = '100%';
 
365
 
366			video.appendChild(source);
 
367			videoContainer.appendChild(video);
 
368			showVideo();
 
369		},
 
370	};
 
371
 
372	const youtubeProvider = {
 
373		getParameters: function (url) {
 
374			const start = url.searchParams.get('start');
 
375
 
376			if (['www.youtube.com', 'youtube.com'].includes(url.hostname)) {
 
377				const videoId = url.searchParams.get('v');
 
378
 
379				if (videoId) {
 
380					return {
 
381						start: start,
 
382						videoId: videoId,
 
383					};
 
384				}
 
385			}
 
386			else if (['www.youtu.be', 'youtu.be'].includes(url.hostname)) {
 
387				const videoId = url.pathname.substr(1);
 
388
 
389				if (videoId) {
 
390					return {
 
391						start: start,
 
392						videoId: videoId,
 
393					};
 
394				}
 
395			}
 
396		},
 
397
 
398		showVideo: function (parameters) {
 
399			const handleAPIReady = function () {
 
400				const player = new YT.Player(videoContainer, {
 
401					events: {
 
402						onReady: function () {
 
403							if (muted) {
 
404								player.mute();
 
405							}
 
406
 
407							showVideo();
 
408						},
 
409					},
 
410					height: height,
 
411					playerVars: {
 
412						autoplay: autoPlay,
 
413						controls: controls ? 0 : 1,
 
414						loop: loop ? 1 : 0,
 
415						playlist: loop
 
416							? parameters.videoId
 
417							: undefined,
 
418						start: !parameters.start ? 0 : parameters.start,
 
419					},
 
420					videoId: parameters.videoId,
 
421					width: width,
 
422				});
 
423			};
 
424
 
425			if ('YT' in window) {
 
426				handleAPIReady();
 
427			}
 
428			else {
 
429				const oldCallback =
 
430					window.onYouTubeIframeAPIReady || function () {};
 
431
 
432				window.onYouTubeIframeAPIReady = function () {
 
433					oldCallback();
 
434					handleAPIReady();
 
435				};
 
436
 
437				const apiSrc = '//www.youtube.com/iframe_api';
 
438
 
439				let script = Array.from(document.querySelectorAll('script')).find(
 
440					function (script) {
 
441						return script.src === apiSrc;
 
442					}
 
443				);
 
444
 
445				if (!script) {
 
446					script = document.createElement('script');
 
447					script.src = apiSrc;
 
448					document.body.appendChild(script);
 
449				}
 
450			}
 
451		},
 
452	};
 
453
 
454	function main() {
 
455		content = document.querySelector('#m-urlVideo');
 
456
 
457		if (!content) {
 
458			return requestAnimationFrame(main);
 
459		}
 
460
 
461		videoContainer = content.querySelector('.video-container');
 
462		errorMessage = content.querySelector('.error-message');
 
463		loadingIndicator = content.querySelector('.loading-animation');
 
464		videoMask = content.querySelector('.video-mask');
 
465
 
466		window.removeEventListener('resize', resize);
 
467
 
468		try {
 
469			let matched = false;
 
470			const url = new URL(content.getAttribute('data-video'));
 
471			const providers = [youtubeProvider, rawProvider];
 
472
 
473			for (let i = 0; i < providers.length && !matched; i++) {
 
474				const provider = providers[i];
 
475				const parameters = provider.getParameters(url);
 
476
 
477				if (parameters) {
 
478					provider.showVideo(parameters);
 
479					matched = true;
 
480				}
 
481			}
 
482
 
483			if (!matched) {
 
484				showError();
 
485			}
 
486		}
 
487		catch (error) {
 
488			showError();
 
489		}
 
490	}
 
491
 
492	main();
 
493		
 
494    Liferay.on(
 
495		'allPortletsReady',
 
496		function() {
 
497			if($(".m-journal-detail__relatedAssets .container").children().length > 0) {
 
498				$(".m-journal-detail__relatedAssets").appendTo(".m-journal-detail__relatedAssetsDest");
 
499				$('.m-genericContent__links').removeClass( "d-none" );
 
500			}
 
501		}
 
502	);
 
503
 
504});
 
505
 
506</script>
 
507
 
508<style>
 
509.m-journal-detail__relatedAssets .container {
 
510	padding: 0;
 
511}
 
512</style>