Cement plant tour - Dyckerhoff Polska
Wystąpił błąd podczas przetwarzania szablonu.
The following has evaluated to null or missing:
==> NewsImage.getAttribute("alt") [in template "20116#20152#52307" at line 19, column 26]
----
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 NewsImage.getAttribute("alt") != "" [in template "20116#20152#52307" at line 19, column 21]
----
1<!-- NEWS Global Web Content Display Template -->
2
3<#include "${templatesPath}/SOCIAL-SHARE-MACRO" />
4<#assign
5 serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()
6 themeDisplay = serviceContext.getThemeDisplay()
7 imageLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.ImageLocalService")
8 url = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent()
9 journalArticleAuthor = .vars['reserved-article-author-name'].data
10/>
11
12<div class="container">
13 <div class="row">
14 <div class="col-sm-8 offset-sm-2">
15
16 <article class="webcontent">
17 <figure class="webcontent__figure">
18
19 <#if NewsImage.getAttribute("alt") != "">
20 <#assign alt = NewsImage.getAttribute("alt") />
21 <#else>
22 <#assign alt = NewsTitle.getData() />
23 </#if>
24
25 <#if NewsImage.getData()?? && NewsImage.getData() != "">
26 <img
27 data-fileentryid="${NewsImage.getAttribute('fileEntryId')}"
28 alt="${alt}"
29 src="${NewsImage.getData()}"
30 class="webcontent__img"
31 />
32 </#if>
33 </figure>
34
35 <#assign
36 imageWidth = 600
37 imageHeight = 600
38 />
39
40 <#if NewsImage.getAttribute("id")??>
41 <#assign imageId = NewsImage.getAttribute("id") />
42 </#if>
43 <#if imageId?? && imageId != "">
44 <#assign image = imageLocalService.fetchImage(imageId?number) />
45 <#if image?? && image?has_content>
46 <#assign
47 imageWidth = image.getWidth()
48 imageHeight = image.getHeight()
49 />
50 </#if>
51 </#if>
52
53 <div class="webcontent__date">
54 <#assign NewsDate_Data = getterUtil.getString(NewsDate.getData()) />
55 <#assign displayDate = "" />
56
57 <#if validator.isNotNull(NewsDate_Data)>
58 <#assign NewsDate_DateObj = dateUtil.parseDate("yyyy-MM-dd", NewsDate_Data, locale) />
59
60 <#if locale == 'de_DE'>
61 <#assign dateFormat = "dd.MMMMyyyy" />
62 <#else>
63 <#assign dateFormat = "dd MMMM yyyy" />
64 </#if>
65
66 <#assign displayDate = dateUtil.getDate(NewsDate_DateObj, dateFormat, locale) />
67 ${displayDate}
68 </#if>
69 </div>
70
71 <#if NewsTitle.getData()?? && NewsTitle.getData() != "">
72 <h1 class="webcontent__title">${NewsTitle.getData()}</h1>
73 <#else>
74 <h1 class="webcontent__title sr-only">${themeDisplay.getLayout().getName(locale)}</h1>
75 </#if>
76 <div class="webcontent__text">${NewsBody.getData()}</div>
77
78 <#if NewsDocument?? && NewsDocument.getSiblings()?has_content>
79
80 <#assign dlAppService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService") />
81 <#assign SPACE_KB = 1024 />
82 <#assign SPACE_MB = SPACE_KB?int * 1024 />
83 <#assign SPACE_GB = SPACE_MB?int * 1024 />
84 <#assign SPACE_TB = SPACE_GB?int * 1024 />
85
86 <div class="file-list">
87 <#list NewsDocument.getSiblings() as file>
88
89 <#if file?? && file?has_content>
90 <#if file.data?? && file.data?has_content>
91 <#assign filedatamap = file.data?eval_json!{} />
92 <#if filedatamap?? && filedatamap?has_content>
93 <#assign uuid = filedatamap.uuid />
94 <#assign dlDocument = dlAppService.getFileEntryByUuidAndGroupId(uuid,groupId) />
95 <#assign dlDocumentSize = dlDocument.size?int />
96
97 <#if dlDocumentSize lt SPACE_KB>
98 <#assign dlDocumentSize = dlDocumentSize?round?string + " B" />
99 <#elseif dlDocumentSize lt SPACE_MB>
100 <#assign dlDocumentSize = dlDocumentSize / SPACE_KB />
101 <#assign dlDocumentSize = dlDocumentSize?round?string + " KB" />
102 <#elseif dlDocumentSize lt SPACE_GB>
103 <#assign dlDocumentSize = dlDocumentSize / SPACE_MB />
104 <#assign dlDocumentSize = dlDocumentSize?round?string + " MB" />
105 <#elseif dlDocumentSize lt SPACE_TB>
106 <#assign dlDocumentSize = dlDocumentSize / SPACE_GB />
107 <#assign dlDocumentSize = dlDocumentSize?round?string + " GB" />
108 <#else>
109 <#assign dlDocumentSize = dlDocumentSize / SPACE_TB />
110 <#assign dlDocumentSize = dlDocumentSize?round?string + " TB" />
111 </#if>
112
113 <div class="file has-icon">
114 <i class="fa fa-file-pdf-o" aria-hidden="true"></i>
115 <div class="file__name">
116 <a href="${file.getData()}" class="file__link" target="_blank">
117 ${dlDocument.getTitle()}
118 </a>
119 </div>
120 <div class="file__info">(${dlDocument.extension?upper_case} ${dlDocumentSize})</div>
121 </div>
122 </#if>
123 </#if>
124 </#if>
125 </#list>
126
127 <#assign urlImage = themeDisplay.getPortalURL() + NewsImage.getData() />
128 <@shareContent title="${NewsTitle.getData()}" summary="${NewsBody.getData()}" detailURL="${url}" imageURL="${urlImage}" />
129 </div>
130 </#if>
131
132 <#include "${templatesPath}/SLIDER_MASTER" />
133 <#include "${templatesPath}/NEWS_ARTICLE_DETAIL_RICH_SNIPPET" />
134 </article>
135 </div>
136 </div>
137</div>