Fehler bei der Verarbeitung der Vorlage.
Java method "com.mecalux.util.service.impl.MlxJournalHelperServiceImpl.getStructureFieldValue(com.liferay.journal.model.JournalArticle, String, String)" threw an exception when invoked on com.mecalux.util.service.impl.MlxJournalHelperServiceImpl object "com.mecalux.util.service.impl.MlxJournalHelperServiceImpl@512a3f6e"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign newsletterWidgetContent = mlx... [in template "20101#20128#BLOG-POST-STR-DEFAULT-TEMPLATE" at line 519, column 17] ----
1<#assign httpUtil = staticUtil["com.liferay.portal.kernel.util.URLCodec"]>
2<style>
3 html {
4 scroll-padding-top: 0;
5 }
6</style>
7
8<#--MKTG-1311 youtubeIframe style -->
9<style>
10 .embed-responsive{position:relative;display:block;width:100%!important;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}
11</style>
12
13<#-- Template generada automáticamente para servir de template por defecto a la estructura Blog - Post Str -->
14<#--MKTG-1196: US Date format -->
15<#assign domain = themeDisplay.getPortalDomain() />
16<#assign dateFormat = "dd MMM yyyy"/>
17<#if (domain?contains("us")) || (domain?contains("interlake")) >
18 <#assign dateFormat = "MMMMMMMMM d, yyyy" />
19</#if>
20
21<#assign article = mlxAssetHelperService.fetchLatestApprovedArticle(groupId, .vars["reserved-article-id"].data) />
22<#assign articleUrl = mlxUrlUtilService.getUrlByJournalArticle(article, locale, groupId)?string />
23<#assign cdn = (mlxUrlUtilService.getCdn(groupId))!"" />
24<#assign globalGroupId = mlxConstants.getLongConstant("GroupIds","GLOBAL")/>
25<#assign listImageUuid = mlxUrlUtilService.getUuidFromLiferayUrl(list_image.getData())!"" />
26<#assign listImageFileEntry = mlxDLFileEntryHelperService.getDLFileEntry(listImageUuid, globalGroupId)!{} />
27<#assign titlealt = (mlxExpandoService.getExpandoValueForClass("com.liferay.document.library.kernel.model.DLFileEntry","mlxDocumentTitle",listImageFileEntry.getFileVersion().getFileVersionId()).getString(locale))!""/>
28
29<#assign domain = themeDisplay.getPortalDomain() />
30<#assign organizationName = 'Mecalux' />
31<#if (domain?contains("us")) || (domain?contains("interlake")) >
32 <#assign organizationName = 'Interlake Mecalux' />
33</#if>
34
35<#assign currentUrl = "https://" + domain + articleUrl />
36<#assign shareUrl = currentUrl />
37<#if (shareUrl?contains("?")) >
38 <#assign shareUrl = shareUrl + "&" />
39<#else>
40 <#assign shareUrl = shareUrl + "?" />
41</#if>
42<#assign shareUrl = shareUrl + "utm_medium=Social-Network&utm_campaign=Widget" />
43
44<#assign shareTwitter = shareUrl + "&utm_source=Twitter" />
45<#assign shareEmail = shareUrl + "&utm_source=Email" />
46<#assign shareLinkedin = shareUrl + "&utm_source=Linkedin" />
47<#assign shareFacebook = shareUrl + "&utm_source=Facebook" />
48<#assign shareWhatsapp = shareUrl + "&utm_source=Whatsapp" />
49
50
51<#assign mlxGroup = mlxExpandoService.getExpandoValueForClass("com.liferay.portal.kernel.model.Group","twitter-site", groupId).getString()/>
52
53<#assign master = "Blog_Detail" />
54
55<article>
56
57<div class="corporate--blog-detail--header">
58
59 <figure class="corporate--blog-detail--header--background-figure">
60 <#assign bigImage = .vars["list_image"].getData()/>
61 <#assign urlParamConcat = bigImage?contains("?")?then("&","?")>
62 ${corporate.img(bigImage+urlParamConcat+'imwidth=320', false, 'srcset="' + bigImage + urlParamConcat + 'imwidth=2048&imdensity=1 2048w,'+ bigImage + urlParamConcat + 'imwidth=1024&imdensity=1 1024w,' + bigImage + urlParamConcat + 'imwidth=640&imdensity=1 640w,'+ bigImage + urlParamConcat + 'imwidth=320&imdensity=1 320w"', 'sizes="(max-width: 320px) 50vw, (max-width: 640px) 50vw, (max-width: 1024px) 50vw, 100vw"', 'alt="' + titlealt + '"', 'fetchpriority="high"', 'title="' + titlealt + '"', 'class="corporate--blog-detail--header--background-image"')}
63 </figure>
64
65 <div class="corporate--blog-detail--header--container">
66 <div class="corporate--blog-detail--header--wrapper">
67
68 <#if (.vars["name"]?has_content) >
69 <h1 data-sticky-title="true" class="corporate--blog-detail--header--heading">${.vars["name"].getData()}</h1>
70 </#if>
71 <div class="corporate--blog-detail--header--specs">
72 <#assign public_date_Data = .vars["public_date"].getData()?date["yyyy-MM-dd"]?long />
73 <#if (public_date_Data > 0) >
74 <#assign public_date_DateObj = dateUtil.newDate(public_date_Data) />
75 <#assign publicDate = dateUtil.getDate(public_date_DateObj, dateFormat, locale, timeZoneUtil.getTimeZone("UTC")) />
76 <#assign publicDateMeta = dateUtil.getDate(public_date_DateObj, "yyyy-MM-dd", locale, timeZoneUtil.getTimeZone("UTC")) />
77 </#if>
78 <b>${publicDate!}</b>
79 <svg viewBox="0 0 24 24">
80 <path d="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M19.03,7.39L20.45,5.97C20,5.46 19.55,5 19.04,4.56L17.62,6C16.07,4.74 14.12,4 12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22C17,22 21,17.97 21,13C21,10.88 20.26,8.93 19.03,7.39M11,14H13V8H11M15,1H9V3H15V1Z"></path>
81 </svg>
82 <span class="spec-desktop" data-js="readingTime" data-js-label='<@corporate.mlxlanguage key="mlx.articles.readtime" />'></span>
83 <span class="spec-mobile" data-js="readingTime" data-js-label="{0} '"></span>
84 </div>
85
86 </div>
87 </div>
88
89</div>
90
91<div class="corporate--section corporate--blog-detail">
92
93 <section class="corporate--blog-detail--row">
94
95 <div class="corporate--blog-detail--social-share">
96 <ul class="corporate--blog-detail--social-share--social-media">
97 <li class="corporate--blog-detail--social-share--social-media-item" style="background-color:#0077b5">
98 <a class="corporate--blog-detail--social-share--social-media-link" href='https://www.linkedin.com/shareArticle?mini=false&url=${httpUtil.encodeURL(shareLinkedin)}&title=${httpUtil.encodeURL(.vars["name"].getData())}' data-track-event-category="${master}:SocialShare" data-track-event-label="LinkedIn" rel="nofollow" target="_blank">
99 <svg class="corporate--blog-detail--detail--social-share--item-icon"
100 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"
101 version="1.1" role="img" aria-labelledby="svg-linkedin" title="LinkedIn" alt="LinkedIn">
102 <title id="svg-linkedin">LinkedIn</title>
103 <g>
104 <path
105 d="M26 25.963h-4.185v-6.55c0-1.56-.027-3.57-2.175-3.57-2.18 0-2.51 1.7-2.51 3.46v6.66h-4.182V12.495h4.012v1.84h.058c.558-1.058 1.924-2.174 3.96-2.174 4.24 0 5.022 2.79 5.022 6.417v7.386zM8.23 10.655a2.426 2.426 0 0 1 0-4.855 2.427 2.427 0 0 1 0 4.855zm-2.098 1.84h4.19v13.468h-4.19V12.495z"
106 fill-rule="evenodd"></path>
107 </g>
108 </svg>
109 </a>
110 </li>
111 <li class="corporate--blog-detail--social-share--social-media-item" style="background-color:#3b5998">
112 <a class="corporate--blog-detail--social-share--social-media-link" href="https://www.facebook.com/sharer.php?u=${httpUtil.encodeURL(shareFacebook)}" data-track-event-category="${master}:SocialShare" data-track-event-label="Facebook" rel="nofollow" target="_blank">
113 <svg class="corporate--blog-detail--detail--social-share--item-icon"
114 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"
115 version="1.1" role="img" aria-labelledby="svg-facebook" title="Facebook" alt="Facebook">
116 <title id="svg-facebook">Facebook</title>
117 <g>
118 <path
119 d="M22 5.16c-.406-.054-1.806-.16-3.43-.16-3.4 0-5.733 1.825-5.733 5.17v2.882H9v3.913h3.837V27h4.604V16.965h3.823l.587-3.913h-4.41v-2.5c0-1.123.347-1.903 2.198-1.903H22V5.16z"
120 fill-rule="evenodd"></path>
121 </g>
122 </svg>
123 </a>
124 </li>
125 <li class="corporate--blog-detail--social-share--social-media-item" style="background-color:#000">
126 <a class="corporate--blog-detail--social-share--social-media-link" href='https://twitter.com/intent/tweet?url=${httpUtil.encodeURL(shareTwitter)}&text=${httpUtil.encodeURL(.vars["name"].getData()) + "+" + mlxGroup}' data-track-event-category="${master}:SocialShare" data-track-event-label="X" rel="nofollow" target="_blank">
127 <svg class="corporate--blog-detail--detail--social-share--item-icon"
128 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-1 -1 26 32"
129 version="1.1" role="img" aria-labelledby="svg-X" title="X" alt="X">
130 <title id="svg-twitter">X</title>
131 <g>
132 <path d="M13.545,10.753l6.042,-6.895l-1.432,0l-5.246,5.987l-4.192,-5.987l-4.834,0l6.338,9.053l-6.338,7.231l1.432,0l5.542,-6.323l4.426,6.323l4.834,0l-6.573,-9.389l0.001,0Zm-1.962,2.239l-0.642,-0.902l-5.11,-7.174l2.2,0l4.123,5.789l0.642,0.902l5.36,7.525l-2.199,0l-4.374,-6.14Z" style="fill:#fff;fill-rule:nonzero;">
133 </path>
134 </g>
135 </svg>
136 </a>
137 </li>
138 <li class="corporate--blog-detail--social-share--social-media-item" style="background-color:#848484">
139 <a aria-label="WhatsApp" class="corporate--blog-detail--social-share--social-media-link" href='mailto:?subject=${httpUtil.encodeURL(.vars["name"].getData())}&body=${httpUtil.encodeURL(shareEmail)}' data-track-event-category="${master}:SocialShare" data-track-event-label="Email" rel="nofollow" target="_blank">
140 <svg class="corporate--blog-detail--detail--social-share--item-icon"
141 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"
142 version="1.1" role="img" aria-labelledby="svg-email" title="Email" alt="Email">
143 <title id="svg-email">Email</title>
144 <g>
145 <path
146 d="M27 22.757c0 1.24-.988 2.243-2.19 2.243H7.19C5.98 25 5 23.994 5 22.757V13.67c0-.556.39-.773.855-.496l8.78 5.238c.782.467 1.95.467 2.73 0l8.78-5.238c.472-.28.855-.063.855.495v9.087z">
147 </path>
148 <path
149 d="M27 9.243C27 8.006 26.02 7 24.81 7H7.19C5.988 7 5 8.004 5 9.243v.465c0 .554.385 1.232.857 1.514l9.61 5.733c.267.16.8.16 1.067 0l9.61-5.733c.473-.283.856-.96.856-1.514v-.465z">
150 </path>
151 </g>
152 </svg>
153 </a>
154 </li>
155 <li class="corporate--blog-detail--social-share--social-media-item only-mobile" style="background-color:#4dc247">
156 <a aria-label="WhatsApp" class="corporate--blog-detail--social-share--social-media-link" href="https://api.whatsapp.com/send?text=${httpUtil.encodeURL(shareWhatsapp)}" data-track-event-category="${master}:SocialShare" data-track-event-label="Whatsapp" rel="nofollow" target="_blank" >
157 <svg class="corporate--blog-detail--detail--social-share--item-icon"
158 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"
159 version="1.1" role="img" aria-labelledby="svg-whatsapp" title="WhatsApp" alt="WhatsApp">
160 <title id="svg-whatsapp">WhatsApp</title>
161 <g>
162 <path
163 d="M19.11 17.205c-.372 0-1.088 1.39-1.518 1.39a.63.63 0 0 1-.315-.1c-.802-.402-1.504-.817-2.163-1.447-.545-.516-1.146-1.29-1.46-1.963a.426.426 0 0 1-.073-.215c0-.33.99-.945.99-1.49 0-.143-.73-2.09-.832-2.335-.143-.372-.214-.487-.6-.487-.187 0-.36-.043-.53-.043-.302 0-.53.115-.746.315-.688.645-1.032 1.318-1.06 2.264v.114c-.015.99.472 1.977 1.017 2.78 1.23 1.82 2.506 3.41 4.554 4.34.616.287 2.035.888 2.722.888.817 0 2.15-.515 2.478-1.318.13-.33.244-.73.244-1.088 0-.058 0-.144-.03-.215-.1-.172-2.434-1.39-2.678-1.39zm-2.908 7.593c-1.747 0-3.48-.53-4.942-1.49L7.793 24.41l1.132-3.337a8.955 8.955 0 0 1-1.72-5.272c0-4.955 4.04-8.995 8.997-8.995S25.2 10.845 25.2 15.8c0 4.958-4.04 8.998-8.998 8.998zm0-19.798c-5.96 0-10.8 4.842-10.8 10.8 0 1.964.53 3.898 1.546 5.574L5 27.176l5.974-1.92a10.807 10.807 0 0 0 16.03-9.455c0-5.958-4.842-10.8-10.802-10.8z"
164 fill-rule="evenodd"></path>
165 </g>
166 </svg>
167 </a>
168 </li>
169 </ul>
170 </div>
171
172
173
174 <section class="corporate--blog-detail--detail" data-js="progressBar" data-fancybox-parent="post-images">
175
176 <#-- ################### Campo contenido tiny (para desestructurizar) CORPO-6443: INIT ###################### -->
177 <#if (post_content?? && post_content.data?has_content) >
178 ${post_content.getData()}
179 </#if>
180 <#-- ################### CORPO-6443: END ####################### -->
181
182 <#assign sections = header.getSiblings() />
183 <#list sections as section >
184 <#assign title_section = section.getData() />
185 <#assign subtitle = section.subtitle.getData() />
186 <#assign paragraphs = section.paragraph_title.getSiblings() />
187 <#assign paragraphs2 = section.paragraph_title2.getSiblings() />
188 <#assign texts = section.text.getSiblings() />
189 <#assign images = section.image.getSiblings() />
190 <#assign cta_hubspot = section.cta_hubspot.getData() />
191
192 <#if (title_section?has_content) >
193 <h2 class="corporate--title-section">${title_section}</h2>
194 </#if>
195 <#if (subtitle?has_content) >
196 <h2 class="corporate--subtitle-section">${subtitle}</h2>
197 </#if>
198
199 <#list paragraphs as paragraph >
200 <#assign paragraphTitle = paragraph.getData() />
201 <#assign paragraphTexts = paragraph.paragraph.getSiblings() />
202 <#if ("${paragraphTitle}" != "") >
203 <h3 class="corporate--title-paragraph">${paragraphTitle}</h3>
204 </#if>
205 <#list paragraphTexts as paragraphText >
206 <#if ("${paragraphText.getData()}" != "") >
207 <p class="corporate--paragraph">${paragraphText.getData()}</p>
208 </#if>
209 </#list>
210 </#list>
211
212 <#if (section.text.getData()?has_content) >
213 <ul class="corporate--unordered-list">
214 <#list texts as text >
215 <#assign text_data = text.getData() />
216 <#if ("${text_data}" != "") >
217 <li class="corporate--unordered-list--item">${text_data}</li>
218 </#if>
219 </#list>
220 </ul>
221 </#if>
222 <#list images as image >
223 <#assign src = image.getData() />
224 <#assign footer = image.image_footer.getData() />
225
226 <#if ("${src}" != "") >
227 <figure class="corporate--figure">
228 <#if ("${footer}" != "") >
229 ${corporate.img(src, true, 'alt="' + footer + '"', 'title="' + footer + '"', 'class="corporate--image"')}
230 <figcaption class="corporate--figcaption">${footer}</figcaption>
231 <#else>
232 ${corporate.img(src, true, 'class="corporate--image"')}
233 </#if>
234 </figure>
235 </#if>
236
237 </#list>
238
239 <#list paragraphs2 as paragraph >
240 <#if (paragraph?has_content) >
241 <#assign paragraphTitle = paragraph.getData()!"" />
242 <#if ("${paragraphTitle}" != "") >
243 <h3 class="corporate--title-paragraph">${paragraphTitle}</h3>
244 </#if>
245 </#if>
246
247 <#if (paragraph.paragraph2?has_content) >
248 <#assign paragraphTexts = paragraph.paragraph2.getSiblings() >
249 <#list paragraphTexts as paragraphText >
250 <#if ("${paragraphText.getData()}" != "") >
251 <p class="corporate--paragraph">${paragraphText.getData()}</p>
252 </#if>
253 </#list>
254 </#if>
255 </#list>
256
257 <#if (cta_hubspot?has_content) >
258 <div class="corporate--cta_hubspot">${cta_hubspot}</div>
259 </#if>
260
261 </#list>
262
263
264 </section>
265
266 </section>
267
268
269
270 <#-- ##############################
271 ####### RELATED ENTRIES #######
272 ################################# -->
273 <#-- Nos faltan estos servicios
274 <#assign mlxSearch=serviceLocator.findService("mecalux-portlet", "com.mecalux.service.MlxSearchLocalService" ) />
275 <#assign articleService=serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService") />
276 <#assign entryService=serviceLocator.findService("com.liferay.portlet.asset.service.AssetEntryLocalService") />
277 <#assign blogPostListViewTpl=mlxConstants.getStringConstant("TplKeys","BLOG_POST_RELATED_ENTRIES") />
278 <#assign article=journalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].getData()) />
279 <#assign entry=entryService.getEntry('com.liferay.portlet.journal.model.JournalArticle', article.getResourcePrimKey()) />
280 <#assign numElements=getterUtil.getInteger("6") />
281 <#assign relatedPosts=mlxSearch.searchRelatedBlogPost(entry, numElements) />
282 -->
283 <#assign article=mlxAssetHelperService.fetchLatestApprovedArticle(groupId, .vars["reserved-article-id"].data) />
284 <#assign assetEntry=mlxAssetHelperService.getAssetEntryByJournalArticle(article)!"" />
285 <#assign categoryId=assetEntry.getCategoryIds()[0]!0 />
286 <#assign sortField="public_date" />
287 <#assign blogPostStrId=article.getDDMStructure().getStructureId() />
288
289 <aside class="corporate--blog-detail--sidebar">
290
291 <#if categoryId !=0>
292 <#assign relatedArticlesList=mlxAssetHelperService.getJournalArticleListByStructureIdAndCategoryIdSortedByStructureFieldName(groupId, themeDisplay.getUserId(), blogPostStrId, categoryId, sortField, locale)!"" />
293 </#if>
294 <#assign recentArticlesList = mlxAssetHelperService.getJournalArticleListByStructureIdIdSortedByStructureFieldName(groupId, themeDisplay.getUserId(), blogPostStrId, sortField, locale)!"" />
295
296
297 <#if relatedArticlesList?has_content || recentArticlesList?has_content >
298
299 <#assign masterList = [] />
300
301 <#if relatedArticlesList?has_content >
302 <#assign numElements=2 />
303 <#else>
304 <#assign numElements=4 />
305 </#if>
306
307 <div class="corporate--blog-detail--sidebar--related">
308
309 <!--relatedArticles-->
310
311 <#if relatedArticlesList?has_content>
312 <#attempt> <#-- bloque conflictivo, tenemos errores indefinidos en RO, ponemos un try catch -->
313 <#-- Aplicamos ?reverse para que se ordenen desc -->
314 <#assign relatedArticlesList=relatedArticlesList?reverse?filter(blog -> blog.articleId != .vars["reserved-article-id"].data) />
315 <#if (relatedArticlesList?has_content && (relatedArticlesList?size > 0))>
316
317 <#if (relatedArticlesList?has_content)>
318
319 <span class="corporate--blog-detail--sidebar--heading"><@corporate.mlxlanguage key="mlx.blog.related-entries" /></span>
320 <ul class="corporate--blog-detail--sidebar--links-list">
321 <#if (relatedArticlesList?size == 1)> <#-- se ha creado esta condicion por si el blog solo tiene UN relacionado, ya que en RO fallaba -->
322 <#assign post = relatedArticlesList[0] />
323 <#assign post = relatedArticlesList[0] />
324 <li class="corporate--blog-detail--sidebar--links-list-item">
325 <#assign master=mlxMastersHelperService.getMasterNameByJournalArticle(post) />
326
327 <#assign masterList = masterList + [master] />
328
329 <#assign journal_asset_url=mlxUrlUtilService.getUrlByJournalArticle(post, locale, groupId)?string />
330 <#assign postValues=mlxJournalHelperService.getStructureFieldValues(post, locale) />
331 <#assign journal_name=(postValues["name"]?string)!"" />
332 <#assign journal_image=postValues["list_image"]!"" />
333
334 <#assign imgObj = jsonFactoryUtil.createJSONObject(journal_image) />
335 <#assign imgUuid = imgObj.getString("uuid") />
336 <#assign urlImg = mlxDocumentsHelperService.getDocumentUrlFromUUID(imgUuid, locale)!"" />
337
338 <a href="${journal_asset_url}" class="corporate--blog-detail--sidebar--link" data-track-event-category="Post_Post_Related-Posts" data-track-event-label="|Blog|Detail|${master}">
339 <figure class="corporate--blog-detail--sidebar--item-figure">
340 <#if imgUuid?has_content>
341 <#assign fileEntry = mlxDLFileEntryHelperService.getDLFileEntry(imgUuid, globalGroupId) />
342 <#assign docUrl = (mlxExpandoService.getExpandoValueForClass("com.liferay.document.library.kernel.model.DLFileEntry","mlxDocumentUrl",fileEntry.getFileVersion().getFileVersionId()).getString(locale))!""/>
343 <#if docUrl == ''>
344 <#assign imgUrl = cdn + urlImg />
345 <#else>
346 <#assign imgUrl = cdn + docUrl + "." + fileEntry.getVersion() + "." + fileEntry.getExtension() />
347 </#if>
348
349 <#assign imgTitle = (mlxExpandoService.getExpandoValueForClass("com.liferay.document.library.kernel.model.DLFileEntry","mlxDocumentTitle",fileEntry.getFileVersion().getFileVersionId()).getString(locale))!""/>
350
351 <#assign imgWidth = 320>
352 <#assign imgTitle = journal_name!imgTitle>
353 <#assign imgAlt = journal_name!imgTitle>
354 <#assign imgClass = 'corporate--blog-detail--sidebar--item-image'>
355 <#assign urlParamConcat = imgUrl?contains("?")?then("&","?")>
356 ${corporate.img(imgUrl + urlParamConcat + 'imwidth=' + imgWidth + '', true,
357 'alt="' + imgAlt + '"', 'title="' + imgTitle + '"', 'class="' + imgClass + '"'
358 'srcset="' + imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 320w,' +
359 imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 640w,' +
360 imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 1024w,' +
361 imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 2048w"')}
362 </#if>
363 </figure>
364 <span class="corporate--blog-detail--sidebar--title">${journal_name}</span>
365 </a>
366 </li>
367 <#assign numElements = 3 /> <#-- ponemos que se vean 3 entradas recientes ya que solo tenemos un relacionado -->
368 <#else>
369
370 <#list relatedArticlesList[0 ..< numElements] as post>
371 <li class="corporate--blog-detail--sidebar--links-list-item">
372 <#assign master=mlxMastersHelperService.getMasterNameByJournalArticle(post) />
373
374 <#assign masterList = masterList + [master] />
375
376 <#assign journal_asset_url=mlxUrlUtilService.getUrlByJournalArticle(post, locale, groupId)?string />
377 <#assign postValues=mlxJournalHelperService.getStructureFieldValues(post, locale) />
378 <#assign journal_name=(postValues["name"]?string)!"" />
379 <#assign journal_image=postValues["list_image"]!"" />
380
381 <#assign imgObj = jsonFactoryUtil.createJSONObject(journal_image) />
382 <#assign imgUuid = imgObj.getString("uuid") />
383 <#assign urlImg = mlxDocumentsHelperService.getDocumentUrlFromUUID(imgUuid, locale)!"" />
384
385 <a href="${journal_asset_url}" class="corporate--blog-detail--sidebar--link" data-track-event-category="Post_Post_Related-Posts" data-track-event-label="|Blog|Detail|${master}">
386 <figure class="corporate--blog-detail--sidebar--item-figure">
387 <#if imgUuid?has_content>
388 <#assign fileEntry = mlxDLFileEntryHelperService.getDLFileEntry(imgUuid, globalGroupId) />
389 <#assign docUrl = (mlxExpandoService.getExpandoValueForClass("com.liferay.document.library.kernel.model.DLFileEntry","mlxDocumentUrl",fileEntry.getFileVersion().getFileVersionId()).getString(locale))!""/>
390 <#if docUrl == ''>
391 <#assign imgUrl = cdn + urlImg />
392 <#else>
393 <#assign imgUrl = cdn + docUrl + "." + fileEntry.getVersion() + "." + fileEntry.getExtension() />
394 </#if>
395
396 <#assign imgTitle = (mlxExpandoService.getExpandoValueForClass("com.liferay.document.library.kernel.model.DLFileEntry","mlxDocumentTitle",fileEntry.getFileVersion().getFileVersionId()).getString(locale))!""/>
397
398 <#assign imgWidth = 320>
399 <#assign imgTitle = journal_name!imgTitle>
400 <#assign imgAlt = journal_name!imgTitle>
401 <#assign imgClass = 'corporate--blog-detail--sidebar--item-image'>
402 <#assign urlParamConcat = imgUrl?contains("?")?then("&","?")>
403 ${corporate.img(imgUrl + urlParamConcat + 'imwidth=' + imgWidth + '', true,
404 'alt="' + imgAlt + '"', 'title="' + imgTitle + '"', 'class="' + imgClass + '"'
405 'srcset="' + imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 320w,' +
406 imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 640w,' +
407 imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 1024w,' +
408 imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 2048w"')}
409 </#if>
410 </figure>
411 <span class="corporate--blog-detail--sidebar--title">${journal_name}</span>
412 </a>
413 </li>
414 </#list>
415 </#if>
416 </ul>
417 </#if>
418
419 </#if>
420 <#recover>
421 </#attempt>
422 </#if>
423
424 </#if>
425
426
427 <!--recentArticles-->
428
429 <#if recentArticlesList?has_content>
430 <#attempt> <#-- bloque conflictivo, tenemos errores indefinidos en RO, ponemos un try catch -->
431
432
433 <#-- Aplicamos ?reverse para que se ordenen desc -->
434 <#assign recentArticlesList=recentArticlesList?reverse?filter(blog -> blog.articleId != .vars["reserved-article-id"].data) />
435 <#if (recentArticlesList?has_content && (recentArticlesList?size > 0))>
436
437 <#if (recentArticlesList?has_content)>
438
439 <span class="corporate--blog-detail--sidebar--heading"><@corporate.mlxlanguage key="mlx.blog.recent-entries" /></span>
440
441 <ul class="corporate--blog-detail--sidebar--links-list">
442 <#list recentArticlesList as post>
443
444 <#if post?index < numElements >
445
446 <li class="corporate--blog-detail--sidebar--links-list-item">
447 <#assign master=mlxMastersHelperService.getMasterNameByJournalArticle(post) />
448
449 <#if !masterList?seq_contains(master)>
450
451 <#assign journal_asset_url=mlxUrlUtilService.getUrlByJournalArticle(post, locale, groupId)?string />
452 <#assign postValues=mlxJournalHelperService.getStructureFieldValues(post, locale) />
453 <#assign journal_name=(postValues["name"]?string)!"" />
454 <#assign journal_image=postValues["list_image"]!"" />
455
456 <#assign imgObj = jsonFactoryUtil.createJSONObject(journal_image) />
457 <#assign imgUuid = imgObj.getString("uuid") />
458 <#assign urlImg = mlxDocumentsHelperService.getDocumentUrlFromUUID(imgUuid, locale)!"" />
459
460 <a href="${journal_asset_url}" class="corporate--blog-detail--sidebar--link" data-track-event-category="Post_Post_Recent-Posts" data-track-event-label="|Blog|Detail|${master}">
461 <figure class="corporate--blog-detail--sidebar--item-figure">
462
463 <#if imgUuid?has_content>
464 <#assign fileEntry = mlxDLFileEntryHelperService.getDLFileEntry(imgUuid, globalGroupId) />
465 <#assign docUrl = (mlxExpandoService.getExpandoValueForClass("com.liferay.document.library.kernel.model.DLFileEntry","mlxDocumentUrl",fileEntry.getFileVersion().getFileVersionId()).getString(locale))!""/>
466 <#if docUrl == ''>
467 <#assign imgUrl = cdn + urlImg />
468 <#else>
469 <#assign imgUrl = cdn + docUrl + "." + fileEntry.getVersion() + "." + fileEntry.getExtension() />
470 </#if>
471
472 <#assign imgTitle = (mlxExpandoService.getExpandoValueForClass("com.liferay.document.library.kernel.model.DLFileEntry","mlxDocumentTitle",fileEntry.getFileVersion().getFileVersionId()).getString(locale))!""/>
473
474 <#assign imgWidth = 320>
475 <#assign imgTitle = journal_name!imgTitle>
476 <#assign imgAlt = journal_name!imgTitle>
477 <#assign imgClass = 'corporate--blog-detail--sidebar--item-image'>
478 <#assign urlParamConcat = imgUrl?contains("?")?then("&","?")>
479 ${corporate.img(imgUrl + urlParamConcat + 'imwidth=' + imgWidth + '', true,
480 'alt="' + imgAlt + '"', 'title="' + imgTitle + '"', 'class="' + imgClass + '"'
481 'srcset="' + imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 320w,' +
482 imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 640w,' +
483 imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 1024w,' +
484 imgUrl + urlParamConcat + 'imwidth=320&imdensity=1 2048w"')}
485 </#if>
486
487 </figure>
488 <span class="corporate--blog-detail--sidebar--title">${journal_name}</span>
489 </a>
490
491 <#else>
492
493 <#assign numElements = numElements + 1 />
494
495 </#if>
496
497
498 </li>
499
500 </#if>
501
502 </#list>
503 </ul>
504 </#if>
505
506 </#if>
507 <#recover>
508 </#attempt>
509
510 </#if>
511
512
513 <#--MKTG-1606 NEWSLETTER Widget (Buscamos contenido y pintamos iframe)-->
514
515 <#assign newsletterWidgetMasterId = 344013 /> <!--Master de PRO 7.2-->
516
517 <#assign newsletterWidgetArticle = mlxMastersHelperService.getJournalArticleByMasterAndGroup(newsletterWidgetMasterId, groupId)!"" />
518 <#if newsletterWidgetArticle != "">
519 <#assign newsletterWidgetContent = mlxJournalHelperService.getStructureFieldValue(newsletterWidgetArticle, "content", locale)?string />
520 <#if newsletterWidgetContent?has_content >
521 <div class="corporate--blog-detail--sidebar-widget" style="padding-top:1.5rem;min-height:275px;">
522 ${newsletterWidgetContent}
523 </div>
524 </#if>
525 </#if>
526
527
528 </div>
529
530
531 <!--MKTG-1464 Obtener blogBanner sidebar por relacionado en blogCategoryStr (según categoría)-->
532 <#if categoryId !=0>
533
534 <#assign blogCategoryStrKey = "BLOG-CATEGORY-STR" />
535 <#assign blogCategoryStrId = 473623 />
536 <#assign blogCategoryArticle = (mlxAssetHelperService.getJournalArticleListByStructureIdAndCategoryId(groupId, themeDisplay.getUserId(), blogCategoryStrId, categoryId))[0]!"" />
537
538 <#if blogCategoryArticle != "">
539
540 <#assign blogBannerStrKey = "BLOG-BANNER-STR" />
541 <#assign bannerRelatedArticle = (mlxAssetHelperService.getFirstRelatedArticle(groupId, blogCategoryArticle.articleId, blogBannerStrKey))!"" />
542
543 <#if bannerRelatedArticle != "">
544 <#assign bannerContent = mlxJournalContentService.getContent(bannerRelatedArticle, bannerRelatedArticle.getDDMTemplateKey(),locale,themeDisplay,'view')!"" />
545
546 <#if bannerContent != "">
547 ${bannerContent}
548 </#if>
549
550 </#if>
551
552 </#if>
553
554 </#if>
555
556 </aside>
557
558</article>
559
560
561<#assign organizationName = 'Mecalux' />
562<#if (domain?contains("us")) || (domain?contains("interlake")) >
563 <#assign organizationName = 'Interlake Mecalux' />
564</#if>
565
566<#-- logo document library -->
567<#assign logo="/documents/20128/3456912/Mecalux-logo_600x60px.jpg/04c628fa-bb4c-0e81-75c9-2e598563979d?t=1582118551000" />
568<#if (domain?contains("es")) || (domain?contains("mecalux.es")) >
569 <#assign logo="/documents/20128/3456912/MecaluxEsmena-logo_600x60px.jpg/55173d2f-aadd-3f09-d3fb-456a758b3bd6?t=1582118551000" />
570</#if>
571<#if (domain?contains("us")) || (domain?contains("interlake")) >
572 <#assign logo="/documents/20128/3456912/InterlakeMecalux-logo_600x60px.jpg/48f97d72-4230-e18c-9424-b06fae217c90?t=1582118551000" />
573</#if>
574
575<script type="text/javascript">
576 window.addEventListener('load', function() {
577
578 var content = document.querySelector("meta[property='og:image']").getAttribute('content');
579 var imageSeo = '${list_image.getData()}' || content;
580
581 var image = new Image();
582 image.src = imageSeo;
583
584 image.onload = function() {
585 var imageWidth = this.width;
586 var imageHeight = this.height;
587
588 var domain = 'https://${domain}';
589 var currentUrl = "${currentUrl}";
590 var headline = "${.vars["name"].getData()}";
591 var description = "${list_summary.getData()}";
592 var datePublished = "${publicDateMeta!}";
593 var organizationName = "${organizationName}";
594 var logo = "${logo}";
595
596 var schema = {
597 "@context": "http://schema.org",
598 "@type": "BlogPosting",
599 "mainEntityOfPage": {
600 "@type": "WebPage",
601 "@id": currentUrl
602 },
603 "headline": headline,
604 "description": description,
605 "image": {
606 "@type": "ImageObject",
607 "url": imageSeo,
608 "width": imageWidth,
609 "height": imageHeight
610 },
611 "datePublished": datePublished,
612 "dateModified": datePublished,
613 "author": {
614 "@type": "Organization",
615 "name": organizationName,
616 "url": domain
617 },
618 "publisher": {
619 "@type": "Organization",
620 "name": organizationName,
621 "logo": {
622 "@type": "ImageObject",
623 "url": logo,
624 "width":600,
625 "height":60
626 }
627 }
628 }
629
630 var script = document.createElement('script');
631 script.type = 'application/ld+json';
632 script.text = JSON.stringify(schema);
633
634 document.querySelector('body').appendChild(script);
635 };
636 });
637</script>
638
639<#-- MKTG-1465:INIT table of contents : en principio solo esta en blog detail, si pasamos a más contenidos, mirar de valorar de pasar al theme -->
640<style>
641 .corporate--blog-detail--toc {
642 position: sticky;
643 top: 6rem;
644 opacity: 0;
645 transition: opacity .33s ease-out;
646 }
647 .corporate--blog-detail--toc.active {
648 opacity: 1;
649 }
650 .corporate--section h2,
651 .corporate--section h3,
652 .corporate--section h3,
653 .corporate--section h4,
654 .corporate--section h5 {
655 scroll-margin-top:80px
656 }
657 .corporate--blog-detail--toc-title {
658 color: #000;
659 display: block;
660 margin-bottom: 1rem;
661 font-family: "Raleway","Helvetica Neue",Arial,Helvetica,sans-serif;
662 font-weight: bold;
663 text-transform: uppercase;
664 background: initial;
665 line-height: inherit;
666 font-size:1.4rem;
667 pointer-events:none; /* para no lanzar fancybox en desktop */
668 }
669 .corporate--blog-detail--toc-list {
670 list-style-type: none;
671 margin: 0;
672 padding: 0;
673 }
674 .corporate--blog-detail--toc-title:before {
675 content: " ";
676 display: flex;
677 padding-top: .7rem;
678 width: 40px;
679 border-top: 2px solid #fa6900;
680 }
681 .corporate--blog-detail--toc-item-link {
682 text-decoration:none;
683 color: #999;
684 font-size: 1rem;
685 }
686 .corporate--blog-detail--toc-item-link.smaller {
687 display: block;
688 font-size: 0.8rem !important;
689 margin-left: 0.8rem;
690
691 }
692 .corporate--blog-detail--toc-item-link.smaller.smaller-h4 {
693 display: block;
694 font-size: 0.8rem !important;
695 margin-left: 1.6rem;
696 }
697 .corporate--blog-detail--toc-item.active .corporate--blog-detail--toc-item-link {
698 color:#222222;
699 }
700 .corporate--blog-detail--toc {
701 display: inline-block !important;
702 }
703 #chk-toc {
704 display:none;
705 }
706
707 /** evitar CLS en mobile **/
708 @media (max-width: 1299px) {
709 .corporate--blog-detail--social-share {
710 min-height:8rem;
711 display: inline-block;
712 }
713 .corporate--blog-detail--social-share--social-media {
714 padding-bottom: 0;
715 }
716 .corporate--blog-detail--toc {
717 opacity: 1; /*siempre visible en mobile*/
718 width:100%;
719
720 }
721 }
722 /** version TOC DROPDOWN init **/
723 @media (max-width: 1299px) {
724 .dropdown.corporate--blog-detail--toc {
725 border: solid 1px #000;
726 display: inline-block;
727 }
728 .dropdown .corporate--blog-detail--toc-item {
729 margin:.5rem 1rem;
730 }
731
732 .dropdown .corporate--blog-detail--toc-list {
733 max-height:0px;
734 transition: max-height .2s cubic-bezier(.7,.3,.3,.7);
735 overflow: hidden;
736 }
737 .dropdown .corporate--blog-detail--toc-title {
738 text-transform: none;
739 pointer-events: initial; /* para poder lanzar fancybox */
740 font-size: 1rem;
741 font-weight: normal;
742 position: relative;
743 margin: .5rem;
744 }
745 .dropdown .corporate--blog-detail--toc-title:before {
746 border: 0;
747 padding: 0;
748 display: none;
749 }
750 .dropdown .corporate--blog-detail--toc-title label {
751 display: flex;
752 flex-direction: row-reverse;
753 cursor: pointer;
754 width: 100%;
755 justify-content: flex-end;
756 }
757 .dropdown .corporate--blog-detail--toc-title label:before {
758 content:" ";
759 background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"><path fill="currentColor" d="M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6l1.41-1.42Z"></path></svg>');
760 background-position: center;
761 background-color: transparent !important;
762 background-repeat: no-repeat;
763 z-index: 100;
764 border: 0;
765 width: 20px;
766 transform: rotate(-90deg);
767 transition: transform .2s cubic-bezier(.7,.3,.3,.7);
768 }
769 .dropdown .corporate--blog-detail--toc-item.active .corporate--blog-detail--toc-item-link {
770 color:#999;
771 }
772 #chk-toc:checked ~ .corporate--blog-detail--toc-list {
773 max-height: 1200px;
774 }
775 #chk-toc:checked ~ .corporate--blog-detail--toc-title label:before {
776 transform: rotate(0deg);
777 }
778 }
779 /** version TOC DROPDOWN end **/
780
781</style>
782<script>
783/**
784 * T O C : control
785 */
786window.addEventListener('load', ()=> {
787
788 // listener para iniciar / mostrar / ocultar la tabla TOC
789 let scrollingClickTab = false;
790
791
792 const initialHash = window.location.hash ? decodeURI(window.location.hash.substring(1)) : false;
793 if (initialHash) {
794 history.replaceState(true, '', window.location.hash)
795 scrollingClickTab = true;
796 setTimeout(()=>{scrollingClickTab = false}, 500)
797 }
798
799 if ("IntersectionObserver" in window){
800 const selectorToObs = "corporate--breadcrumb";
801 let objectToObserve = document.getElementsByClassName(selectorToObs).length ? document.getElementsByClassName(selectorToObs).item(0) : null;
802 if (objectToObserve) {
803 // intersection observer setup
804 let observerOptions = {root: null, rootMargin:'0px', threshold: 0.1};
805 function observerCallback(entries, observer) {
806 for (const element of entries) {
807 let entry = element;
808 if ("TOCTable" in mecalux) {
809 if (entry.isIntersecting && scrollingClickTab == false) {
810 mecalux.TOCTable.activate(false) //inactive
811 } else {
812 mecalux.TOCTable.activate(true); //activate
813 }
814 }
815 }
816 }
817 let stickyObserver = new IntersectionObserver(observerCallback, observerOptions);
818 stickyObserver.observe(objectToObserve);
819 }
820 }
821 /**
822 * OBJ: mecalux.TOCTable : crear y controlar el objeto de Table of Contents
823 *
824 * description: lee el contenido del blog, buscando h2, h3, ...h6, y crea una tabla con enlaces con anchors a estos contenidos
825 *
826 */
827
828 mecalux.TOCTable = (function() {
829 //private
830 const SEL = "corporate--blog-detail--detail";
831 const WRAPPER = "corporate--blog-detail--social-share";
832 const TITLE = '<@corporate.mlxlanguage key="mlx.blog.toc" />'; //variable de language
833 const STYLES = ``;
834
835 //public
836 return {
837 loaded : false,
838 items : [],
839 toc_items:[],
840 addStyles : function() {
841 let styleSheet = document.createElement("style")
842 styleSheet.innerText = USEMODAL ? STYLESMODAL : STYLES;
843 document.head.appendChild(styleSheet);
844 },
845 activate : function(isActive) {
846 const wrapper = document.getElementsByClassName("corporate--blog-detail--toc") ? document.getElementsByClassName("corporate--blog-detail--toc").item(0) : null;
847
848 if (wrapper) {
849 if (isActive) {
850 wrapper.classList.add("active");
851 } else {
852 wrapper.classList.remove("active");
853 }
854 }
855 },
856 activateTocLink : function(item_index) {
857 this.toc_items.forEach((element, index) => {
858 if (index === item_index) {
859 this.toc_items[index].classList.add("active");
860 }else{
861 this.toc_items[index].classList.remove("active");
862 }
863 })
864 },
865 addGTMEvent : function(element) {
866 if (!("gtm" in mecalux)) {
867 return;
868 }
869 let eventName = "click";
870 let eventLabel = element.getAttribute("data-gtm-event-label") || "";
871 let eventCategory = element.getAttribute("data-gtm-event-click-category") || mecalux.pagePath.split('/')[1] || '';
872 eventCategory = mecalux.gtm.replaceCustomTags(eventCategory);
873 eventLabel = mecalux.gtm.replaceCustomTags(eventLabel);
874 let infoGtm = {
875 clickType:'CTA',
876 clickLocation:'Body',
877 clickElement:element.getAttribute('class') || '',
878 pagePath:mecalux.pagePath
879 };
880 let eventCallBack = null;
881 mecalux.gtm.addEventToDataLayer(eventName, eventCategory, eventLabel, infoGtm, eventCallBack);
882 },
883 init : function() {
884 if (this.loaded)
885 return;
886
887 // 0 : add styles
888 //this.addStyles();
889
890 //1 : read headings in content
891 const HEADINGS = document.getElementsByClassName(SEL).length > 0 ? document.getElementsByClassName(SEL).item(0).querySelectorAll("h2,h3,h4,h5") : [];
892 HEADINGS.forEach((item, index) => {
893 const label = item.innerText.trim();
894 if (label == "" || label.toLowerCase() == " "){ //omitir tags vacíos
895 return;
896 }
897 const itemId = this.clearSpecialChars(label);
898 item.setAttribute("id", itemId);
899
900 //3 : add item a lista de TOC
901 this.items.push(item);
902 })
903
904 //4 : paint TOC
905 this.insertTOC();
906
907 //5 : flag para evitar se vuelva a pintar
908 this.loaded = true;
909
910 //6: add intersection observer
911 this.addIntersecctionObserver();
912 },
913 insertTOC : function() {
914 if (document.getElementsByClassName(WRAPPER).length < 1)
915 return;
916
917 let listWrapper = document.createElement("aside");
918 listWrapper.setAttribute("class", "corporate--blog-detail--toc")
919 listWrapper.setAttribute("id", "toc-dialog")
920 listWrapper.classList.add("dropdown")
921
922 let title = document.createElement("div");
923 title.setAttribute("class", "corporate--blog-detail--toc-title")
924
925
926 let chk = document.createElement("input");
927 chk.setAttribute("type", "checkbox");
928 chk.setAttribute("id", "chk-toc");
929 chk.setAttribute("name", "chk-toc");
930 listWrapper.appendChild(chk);
931
932 let label = document.createElement("label");
933 label.setAttribute("for", "chk-toc");
934 label.textContent = TITLE;
935 title.appendChild(label);
936
937
938 listWrapper.appendChild(title);
939
940 let list = document.createElement("ol"); // ol
941 list.setAttribute("class", "corporate--blog-detail--toc-list")
942 const _this = this;
943 this.items.forEach((element, index) => {
944 let li = document.createElement("li"); // ol li
945 li.setAttribute("class", "corporate--blog-detail--toc-item")
946
947 let anchor = document.createElement("a"); // ol li a
948 anchor.setAttribute("href", "#" + element.getAttribute("id"))
949 anchor.setAttribute("class", "corporate--blog-detail--toc-item-link")
950 anchor.setAttribute("data-gtm-event", "click")
951 anchor.setAttribute("data-gtm-event-label", "#TOC-" + index);
952 anchor.setAttribute("data-gtm-event-category", "[pageMaster]_TOC");
953 anchor.setAttribute("data-gtm-event-click-category", "[pageMaster]_TOC");
954
955 if (element.tagName != "H1" && element.tagName != "H2") {
956 anchor.classList.add("smaller")
957 if (element.tagName != "H3") { //a partir de h4 smaller smaller
958 anchor.classList.add("smaller-" + element.tagName.toLowerCase())
959 }
960 }
961
962 anchor.addEventListener('click', function(e) {
963 _this.addGTMEvent(e.currentTarget);
964
965 scrollingClickTab = true;
966
967 setTimeout(()=>{_this.activateTocLink(index)}, 300);
968 setTimeout(()=>{scrollingClickTab = false}, 1000);
969 }, false)
970 anchor.textContent = element.innerText;
971
972 li.appendChild(anchor);
973 list.appendChild(li);
974
975 this.toc_items.push(li);
976
977 //preseleccionar item en la carga inicial, si viene ya desde la URL (enlace directo)
978 if (element.getAttribute("id") === initialHash) {
979 li.classList.add("active");
980 setTimeout(element.scrollIntoView({behaviour:'smooth', block:'start',inline:'start'}), 200)
981 }
982
983 })
984 listWrapper.appendChild(list);
985 document.getElementsByClassName(WRAPPER)[0].appendChild(listWrapper); // wrapper title ol li a
986 },
987 addIntersecctionObserver : function() {
988 let options = {
989 root: null,
990 rootMargin: "100px",
991 threshold: 0.5,
992 };
993 let callback = (entries, observer) => {
994 entries.forEach((entry) => {
995 if (entry.isIntersecting && scrollingClickTab == false) {
996 const item_index = this.items.indexOf(entry.target);
997 this.activateTocLink(item_index);
998 }
999 });
1000 };
1001 let observer = new IntersectionObserver(callback, options);
1002
1003 this.items.forEach((element, index) => {
1004 observer.observe(element);
1005 })
1006 },
1007 clearSpecialChars : function (str) {
1008 return str.replace(/[`«»~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\¿?!¡/]/gi, '').replace(/ /gi,'-').replace(/ /gi,'-').toLowerCase();
1009 }
1010
1011 }//return
1012 })()//fin OBJ mecalux.TOCTable
1013
1014 //init
1015 mecalux.TOCTable.init();
1016})
1017</script>
1018<#-- MKTG-1465:END table of contents -->
Fehler bei der Verarbeitung der Vorlage.
Java method "com.mecalux.util.service.impl.MlxJournalHelperServiceImpl.getStructureFieldValue(com.liferay.journal.model.JournalArticle, String, String)" threw an exception when invoked on com.mecalux.util.service.impl.MlxJournalHelperServiceImpl object "com.mecalux.util.service.impl.MlxJournalHelperServiceImpl@512a3f6e"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign name = mlxJournalHelperServic... [in template "20101#20128#3282427" at line 22, column 41] ----
1<#-- ¡ATENCIÓN! PLANTILLA USADA EN BLOG HOME/CATEGORY/DETALLE, PROVISIONALMENTE SE TRIPLICAN SUS CLASES -->
2
3<#assign realUrl = portalUtil.getCurrentURL(renderRequest) />
4<#assign mainJA = (mlxUrlUtilService.getJournalArticleByUrl(themeDisplay))!"" />
5
6<#-- Cambiar por el strKey de Blog - Category Str que corresponda en cada entorno -->
7<#assign blogCategoryStrKey = "BLOG-CATEGORY-STR" />
8
9<#assign trackCategory = "Post_Post_Recent-Posts" />
10<#if (mainJA?has_content) && (mainJA.getDDMStructure().getStructureKey() == blogCategoryStrKey) >
11 <#assign trackCategory = "CAT_Post_Recent-Posts" />
12</#if>
13
14<div class="corporate--blog--lastentries--container corporate--blog-detail--lastentries--container corporate--blog-categories--lastentries--container">
15 <div class="corporate--blog--lastentries corporate--blog-detail--lastentries corporate--blog-categories--lastentries">
16 <h3 class="corporate--blog--lastentries--heading corporate--blog-detail--lastentries--heading corporate--blog-categories--lastentries--heading"><@corporate.mlxlanguage key="mlx.blog.recent-entries" /></h3>
17
18 <#if entries?has_content >
19 <ul class="corporate--blog--lastentries--links-list corporate--blog-detail--lastentries--links-list corporate--blog-categories--lastentries--links-list">
20 <#list entries as curEntry >
21 <#assign article = mlxAssetHelperService.getJournalArticleByEntry(curEntry) />
22 <#assign name = mlxJournalHelperService.getStructureFieldValue(article, "name", "${locale}") />
23 <#assign url = mlxUrlUtilService.getUrlByJournalArticle(article, "${locale}", groupId)?string />
24 <#assign master = mlxMastersHelperService.getMasterNameByJournalArticle(article) />
25 <li class="corporate--blog--lastentries--links-list-item corporate--blog-detail--lastentries--links-list-item corporate--blog-categories--lastentries--links-list-item">
26 <a href="${url}" title="${name}" class="corporate--blog--lastentries--link corporate--blog-detail--lastentries--link corporate--blog-categories--lastentries--link" data-track-event-category="${trackCategory}" data-track-event-label="|Blog|Detail|${master}">
27 <p class="corporate--blog--relatedposts--title corporate--blog-detail--relatedposts--title corporate--blog-categories--relatedposts--title">${name}</p>
28 </a>
29 </li>
30 </#list>
31 </ul>
32 </#if>
33
34 </div>
35</div>