News - Dyckerhoff Polska
Web Content Article
An error occurred while processing the template.
Failed to "?eval_json" string with this error:
---begin-message---
Empty JSON (contains no value)
Error location: At the end of text.
---end-message---
The failing expression:
==> newsImgJson?eval_json [in template "20116#20152#52312" at line 58, column 40]
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign newsImg = newsImgJson?eval_js... [in template "20116#20152#52312" at line 58, column 21]
----
1<#include "${templatesPath}/NEWS_RICH_SNIPPET" />
2<#include "${templatesPath}/FUNCTION" />
3
4<#assign
5 groupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService")
6 site = groupLocalService.getGroup(themeDisplay.getScopeGroupId())
7 siteClassName = portalUtil.getClassName(site.classNameId)
8 journalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
9 userService = serviceLocator.findService("com.liferay.portal.kernel.service.UserService")
10 dlAppService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService")
11/>
12
13<!-- News Global ADT -->
14
15<#if entries?? && entries?has_content>
16 <#list entries as curEntry>
17
18 <#if locale == 'de_DE'>
19 <#assign dateFormat = "dd.MMMMyyyy" />
20 <#else>
21 <#assign dateFormat = "dd MMMM yyyy" />
22 </#if>
23
24 <#assign fields = adt_tool.getFreemarkerMap(curEntry.getClassPK(),locale,dateFormat) />
25 <#assign newsTitle = fields.NewsTitle.value />
26
27 <#if fields.NewsImageListSmall.value?? && fields.NewsImageListSmall.value?has_content
28 && fields.NewsImageListSmall.value != "{}" && fields.NewsImageListSmall.value != "">
29 <#assign newsImgJson = fields.NewsImageListSmall.value />
30 <#else>
31 <#assign newsImgJson = "" />
32 </#if>
33
34 <#assign newsBody = fields.NewsBody.value />
35 <#if !newsImgJson?? || newsImgJson=="">
36 <#assign newsImgJson = fields.NewsImage.value />
37 </#if>
38
39 <#if newsImgJson?? && newsImgJson?has_content>
40 <#assign newsImg = newsImgJson?eval_json?default({}) />
41 </#if>
42 <#assign newsDate = fields.NewsDate.value[0] />
43
44 <#assign article = journalService.getLatestArticle(curEntry.getClassPK()) />
45 <#assign articleGroupId = article.getGroupId() />
46 <#assign articleGroup = groupLocalService.getGroup(articleGroupId?number) />
47 <#assign articleOwnerId = article.getUserId() />
48 <#assign articleOwnerFullName = adt_tool.getUserFullName(articleOwnerId) />
49
50 <#assign urlTitle = article.getUrlTitle() />
51
52 <#if (curEntry_index % 3) == 0>
53 <div class="row">
54 </#if>
55
56 <#if (curEntry_index % 6) == 0 || (curEntry_index % 6) == 5>
57 <#assign newsImgJson = fields.NewsImage.value />
58 <#assign newsImg = newsImgJson?eval_json?default({}) />
59 <div class="col-sm-6">
60 <#else>
61 <div class="col-sm-3">
62 </#if>
63 <article class="news equalheight">
64 <#attempt>
65 <#if newsImg?? && newsImg?has_content>
66
67 <#assign dlDocument = dlAppService.getFileEntryByUuidAndGroupId(newsImg.uuid,newsImg.groupId?number) />
68 <#assign dUrl = adt_tool.getDLDownloadUrl(dlDocument,themeDisplay,"") />
69
70 <#if newsImg.alt != "">
71 <#assign alt = newsImg.alt />
72 <#else>
73 <#assign alt = newsTitle />
74 </#if>
75
76 <figure class="news__figure">
77 <img src="${dUrl}" alt='${alt}' class="news__img" />
78 </figure>
79 </#if>
80 <#recover>
81 </#attempt>
82
83 <#assign newsCategory = "" />
84 <#assign categories = curEntry.getCategories() />
85 <#list categories as category>
86
87 <#if category?index != 0>
88 <#assign newsCategory += ", " />
89 </#if>
90
91 <#if category.getTitle(locale)?? >
92 <#assign newsCategory += category.getTitle(locale) />
93 <#else>
94 <#assign newsCategory += category.getName() />
95 </#if>
96 </#list>
97
98 <#if !newsCategory??>
99 <#assign newsCategory = " " />
100 </#if>
101 <div class="news__category">${newsCategory}</div>
102
103 <div class="news__text">
104 <div class="news__date">${newsDate}</div>
105 <#assign newsDetailUrl = template_tool.getGroupURL(themeDisplay) + "/w/" + urlTitle />
106 <h3 class="news__title">
107 <a href="${newsDetailUrl}" title="${newsTitle}" class="news__link">${newsTitle}</a>
108 </h3>
109 </div>
110 </article>
111 </div>
112
113 <#if (curEntry_index % 3) == 2 || curEntry?is_last>
114 </div>
115 </#if>
116
117 <@rich_snippet_news_article
118 title=getShortenText(newsTitle,100)
119 detailUrl=newsDetailUrl
120 imageUrl=dUrl
121 body=newsBody
122 publishDate=newsDate
123 modifiedDate=article.getModifiedDate()
124 journalArticleAuthor=articleOwnerFullName
125 newsGroup=articleGroup
126 />
127 </#list>
128</#if>