Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing: ==> layout.getGroup().getExpandoBridge().getAttribute("site_blogs_asset_publisher_instance_id") [in template "10136#10174#116227087" at line 41, column 51] ---- 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 site_blogs_asset_publisher_in... [in template "10136#10174#116227087" at line 41, column 1] ----
1<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
2<#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") />
3<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
4
5
6
7
8<#assign groupFriendlyURL = themeDisplay.getScopeGroup().getFriendlyURL() />
9<#assign friendlyURL = themeDisplay.getScopeGroup().getPathFriendlyURL(false,themeDisplay) + groupFriendlyURL />
10<#assign actualURLFriendly = portalUtil.getHost(request) + friendlyURL />
11<#assign scopeGroupId = themeDisplay.getScopeGroupId() />
12
13<#assign PortalUtil = staticUtil["com.liferay.portal.kernel.util.PortalUtil"] />
14<#assign URLEncoder = staticUtil["java.net.URLEncoder"] />
15<#assign Normalizer = staticUtil["java.text.Normalizer"] />
16<#assign currentGroupSite = themeDisplay.getLayout().getGroup().getFriendlyURL() />
17<#if themeDisplay.getLayout().getPrivateLayout() == true >
18 <#assign state = themeDisplay.getPathFriendlyURLPrivateGroup()/>
19<#else>
20 <#assign state = themeDisplay.getPathFriendlyURLPublic()/>
21</#if>
22
23
24
25<#assign imagen = languageUtil.get(locale, "listado.noticia.imagen")>
26<#assign texto = languageUtil.get(locale, "listado.noticia.texto")>
27<#assign instanceId = themeDisplay.getPortletDisplay().getId()?replace("com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_", "")>
28<#assign originalInstanceId = themeDisplay.getPortletDisplay().getId()?replace("com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_", "")>
29<#assign currentPageUrl = PortalUtil.getLayoutURL(themeDisplay.getLayout(),themeDisplay)>
30<#assign currentLayoutFriendlyUrl = themeDisplay.getLayoutFriendlyURL(themeDisplay.getLayout())>
31
32<#-- custom fields
33<#assign expandos = themeDisplay.getScopeGroup().getExpandoBridge().getAttributes()>
34<#list expandos?keys as key>
35 ${key}
36</#list>
37-->
38
39
40<#-- site_blogs_asset_publisher_instance_id name of the custom field for the asset publisher instance id of the site -->
41<#assign site_blogs_asset_publisher_instance_id = layout.getGroup().getExpandoBridge().getAttribute("site_blogs_asset_publisher_instance_id")>
42<#-- by default the main site asset publisher id -->
43<#assign site_blogs_asset_publisher_instance_id_default = layout.getGroup().getExpandoBridge().getAttributeDefault("site_blogs_asset_publisher_instance_id")>
44<#-- site_blogs_url name of the custom field url of the news page of the site -->
45<#assign site_blogs_url = themeDisplay.getScopeGroup().getExpandoBridge().getAttribute("site_blogs_url")>
46<#-- by default the main site news page -->
47<#assign site_blogs_url_default = themeDisplay.getScopeGroup().getExpandoBridge().getAttributeDefault("site_blogs_url")>
48
49
50<#-- get site_blogs_url custom field value for the site -->
51<#list site_blogs_url?keys as key>
52 <#if key == locale>
53 <#assign site_blogs_url_value = site_blogs_url?values[key?index]>
54 </#if>
55</#list>
56
57<#-- get site_blogs_url custom field default value-->
58<#list site_blogs_url_default?keys as key>
59 <#if key == locale>
60 <#assign site_blogs_url_default_value = site_blogs_url_default?values[key?index]>
61 </#if>
62</#list>
63
64<#-- assign the url if the site has custom field. Use the default value otherwise-->
65<#if site_blogs_url_value??>
66<#else>
67 <#if site_blogs_url_default_value??>
68 <#assign site_blogs_url_value = site_blogs_url_default_value>
69 </#if>
70</#if>
71
72<#-- assign the instance id if the site has custom field. Use the default value otherwise-->
73<#if site_blogs_asset_publisher_instance_id??>
74<#else>
75 <#if site_blogs_asset_publisher_instance_id_default??>
76 <#assign site_blogs_asset_publisher_instance_id = site_blogs_asset_publisher_instance_id_default>
77 </#if>
78</#if>
79
80
81<section class="unav-news-list">
82 <#if entries?has_content>
83 <#list entries as curEntry>
84 <#assign article = journalArticleLocalService.fetchLatestArticle(curEntry.getClassPK()) />
85 <#assign assetRendererDate = curEntry.getAssetRenderer() />
86 <#assign contentFecha = assetRendererDate.getDisplayDate()?date />
87 <#assign contentFechaURLString = contentFecha?date?string["dd/MM/yyyy"] />
88 <#assign contentFechaString = contentFecha?date?string["dd | MM | yyyy"] />
89
90 <#assign aArticleXML = saxReaderUtil.read(article.getContentByLocale(locale)) />
91 <#assign tituloNoticia = aArticleXML.valueOf("//dynamic-element[@name='Titulo_noticia']/dynamic-content/text()") />
92 <#assign autorNombre = aArticleXML.valueOf("//dynamic-element[@name='Nombre_autor']/dynamic-content/text()") />
93 <#assign autorImagen = aArticleXML.valueOf("//dynamic-element[@name='Autor_imagen']/dynamic-content/text()") />
94 <#assign jsonObjectString = aArticleXML.valueOf("//dynamic-element[@name='Imagen']/dynamic-content/text()") />
95
96 <#assign parrafoNoticia = aArticleXML.valueOf("//dynamic-element[@name='parrafo_noticia']/dynamic-content/text()") />
97 <#assign otrosDatos = aArticleXML.valueOf("//dynamic-element[@name='Otros_datos']/dynamic-content/text()") />
98
99 <#assign video = aArticleXML.valueOf("//dynamic-element[@name='Video_youtube']/dynamic-content/text()") />
100
101 <#assign friendlyContentURL = assetPublisherHelper.getAssetViewURL(portalUtil.getLiferayPortletRequest(renderRequest), portalUtil.getLiferayPortletResponse(renderResponse), curEntry,true) />
102
103 <#assign tituloNoticiaEncoded = friendlyUrlDecode(tituloNoticia)>
104
105 <#-- Asset publisher instance id in main domain -->
106 <#assign mainDomainInstanceId = "lovPblW1fC70">
107 <#-- Urls generated always the same page for unav requirements-->
108 <#-- In main domain, go to main news page and use that asset publisher id. Causes issues with other domains -->
109 <#-- TODO: remove once custom fields are created-->
110 <#assign urlNews = languageUtil.get(locale, "url.news.details", "/noticias")>
111 <#assign instanceId = mainDomainInstanceId>
112
113 <#-- Configure url and asset publisher instance id with customFields-->
114 <#-- By default configured with main domain news page and asset publisher id. Other domains have to configure it manually in the site configuration -->
115 <#if site_blogs_url_value??>
116 <#assign urlNews = site_blogs_url_value>
117 </#if>
118 <#if site_blogs_asset_publisher_instance_id??>
119 <#assign instanceId = site_blogs_asset_publisher_instance_id>
120 </#if>
121
122 <#-- WORKAROUND FOR TEMPORAL SITES GO LIVE -->
123 <#-- lfr.cloud domain urls work differecontly, redirection to site news has to be adapted for it-->
124 <#if actualURLFriendly?contains("lfr.cloud")>
125 <#-- 1. Site with default news page. if using the default value, redirect to main site and use mainDomainInstanceId.-->
126 <#if site_blogs_url_default_value == site_blogs_url_value>
127 <#assign urlNews = site_blogs_url_value>
128 <#assign instanceId = mainDomainInstanceId>
129 <#else>
130 <#-- 2. Site with custom news page. if site site_blogs_url_value contains /web/site/, use site_blogs_url_value as is and use originalInstanceId to redirect within the site-->
131 <#if site_blogs_url_value?contains("/web"+groupFriendlyURL)>
132 <#assign urlNews = site_blogs_url_value>
133 <#assign instanceId = originalInstanceId>
134
135 <#-- 3. Site with custom domain and custom news page. if site site_blogs_url_value doesn't contain /web/site/ , prepend /web/site to it, to redirect within the site-->
136 <#else>
137 <#assign urlNews = "/web"+groupFriendlyURL + site_blogs_url_value>
138 <#assign instanceId = originalInstanceId>
139 </#if>
140 </#if>
141
142 </#if>
143
144 <#assign urlDetail = urlNews+"/-/contents/"+contentFechaURLString+"/"+tituloNoticiaEncoded+"/content/"+instanceId+"/"+curEntry.getEntryId()>
145
146<#assign foto = "" >
147 <a href="${urlDetail}" class="unav-news-list__item">
148 <#if jsonObjectString?? && jsonObjectString?has_content>
149 <#attempt>
150 <#assign jsonObject = jsonObjectString?eval>
151 <#assign entryUuid = jsonObject.uuid />
152 <#assign entryGroupId = getterUtil.getLong(jsonObject.groupId) />
153 <#assign dlFileEntry = dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(entryUuid, entryGroupId) />
154 <#assign assetEntry = assetEntryLocalService.getEntry("com.liferay.document.library.kernel.model.DLFileEntry", dlFileEntry.fileEntryId) />
155 <#assign assetRenderer = assetEntry.assetRenderer />
156 <#assign foto = assetRenderer.getURLDownload(themeDisplay) />
157
158 <div class="unav-news-list__img" style="background-image: url('${foto});"> </div>
159 <#recover>
160
161 </#attempt>
162 </#if>
163 <#if video?has_content>
164 <#if foto == "">
165
166 <div class="unav-news-list__img" style="background-image:url(http://img.youtube.com/vi/${video}/0.jpg)">
167 </div>
168 </#if>
169 </#if>
170
171 <div class="unav-news-list__container-txt">
172
173 <p class="unav__text unav__text--m">${tituloNoticia}</p>
174
175 ${parrafoNoticia}
176
177 ${otrosDatos}
178
179 </div>
180 </a>
181 </#list>
182 </#if>
183
184
185</section>
186
187<script>
188 $(document).ready( function() {
189 // Avoid lost focus when paginate
190 if ($('.lfr-pagination-buttons')) {
191 var paginationButtons = $('.lfr-pagination-buttons').children();
192 for (const paginationButton of paginationButtons) {
193 var link = $(paginationButton).children();
194 if(link) {
195 $(link).click(function(e){
196 e.preventDefault();
197 var url = $(this).attr('href');
198 window.location.href = url + '#unav-news-list';
199 });
200 }
201 }
202 }
203 });
204</script>
205
206<style>
207 .unav-news-list__container-txt{
208 color:black;
209 }
210</style>
211
212<#function friendlyUrlDecode title>
213
214 <#assign titleFriendly = title>
215 <#assign titleFriendly = titleFriendly?replace("á", "a", "r")>
216 <#assign titleFriendly = titleFriendly?replace("é", "e", "r")>
217 <#assign titleFriendly = titleFriendly?replace("Ã", "i", "r")>
218 <#assign titleFriendly = titleFriendly?replace("ó", "o", "r")>
219 <#assign titleFriendly = titleFriendly?replace("ú", "u", "r")>
220 <#assign titleFriendly = titleFriendly?replace("ñ", "n", "r")>
221 <#assign titleFriendly = URLEncoder.encode(titleFriendly)>
222 <#assign titleFriendly = titleFriendly?replace("\\+", "-","r")>
223 <#return titleFriendly>
224</#function>