An error occurred while processing the template.
The following has evaluated to null or missing:
==> .vars['reserved-article-display-date']  [in template "20116#20152#BKS-NEWS-ENTRY" at line 8, column 23]

----
Tip: It's the final [] step that caused this error, not those before it.
----
Tip: If the failing expression is known to be 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: displaydate = .vars["reserved-article...  [in template "20116#20152#BKS-NEWS-ENTRY" at line 8, column 9]
	- Reached through: #assign-container  [in template "20116#20152#BKS-NEWS-ENTRY" at line 1, column 1]
----
1<#assign  
2	DLFileEntryService = serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService') 
3	DLAppService = serviceLocator.findService('com.liferay.document.library.kernel.service.DLAppService') 
4	DLUtil = serviceLocator.findService('com.liferay.document.library.kernel.util.DLUtil') 
5 
6	defaultDateFormat = "dd.MM.yyyy" 
7 
8	displaydate = .vars['reserved-article-display-date'].data 
9/> 
10 
11<div class="portlet-boundary portlet-borderless portlet-journal-content"> 
12	<div class="portlet"> 
13		<div class="portlet-content"> 
14			<div class=" portlet-content-container"> 
15				<div class="portlet-body"> 
16					<div class="journal-content-article"> 
17						<div class="content-large"> 
18							<h1>${Heading.getData()}</h1> 
19							<p>${formatDate(displaydate, defaultDateFormat)}</p> 
20							<p>${Summary.getData()}</p> 
21						</div> 
22					</div> 
23				</div> 
24			</div> 
25		</div> 
26	</div> 
27</div> 
28 
29<div class="portlet-boundary portlet-bordered portlet-journal-content"> 
30	<div class="portlet"> 
31		<div class="portlet-content panel"> 
32			<div class="portlet-content-container"> 
33				<div class="portlet-body"> 
34					<div class="journal-content-article"> 
35						<@initMediaValues/> 
36						<#assign mediaData = getMediaTypeData(Video VideoFileEntry Image) /> 
37						<#if mediaData['hasMedia']> 
38							<figure class="content-media-element media-element-left ${mediaData['mediaCssClass']}"> 
39								<@renderMedia Video VideoFileEntry Image mediaData/> 
40								 
41								<#if Caption.getData()?? && Caption.getData() != ""> 
42									<figcaption class="media-element-caption">${Caption.getData()}</figcaption> 
43								</#if> 
44							</figure> 
45						</#if> 
46						${Content.getData()} 
47					</div> 
48				</div> 
49			</div> 
50		</div> 
51	</div> 
52</div> 
53 
54<#if Document.getSiblings()?has_content && Document.getSiblings()?first.getData()?? && Document.getSiblings()?first.getData() != ""> 
55	<div class="portlet-boundary portlet-decorate portlet-journal-content"> 
56		<div class="portlet"> 
57			<div class="portlet-content panel"> 
58				<div class="panel-heading portlet-title-container"> 
59					<h2 class="panel-title"><span class="portlet-title-text"><@liferay.language key="bks-label-downloads" /></span></h2> 
60				</div> 
61				<div class="panel-body"> 
62					<div class=" portlet-content-container"> 
63						<div class="portlet-body"> 
64							<div class="journal-content-article"> 
65								<ul class="unstyled link-list"> 
66									<#list Document.getSiblings() as cur_Document> 
67										<#if cur_Document.getData()?? && cur_Document.getData() != ""> 
68											<li> 
69												<@getDocumentDownloadLink cur_Document/> 
70											</li> 
71										</#if> 
72									</#list> 
73								</ul> 
74							</div> 
75						</div> 
76					</div> 
77				</div> 
78			</div> 
79		</div> 
80	</div> 
81</#if> 
82 
83<#macro getDocumentDownloadLink cur_Document> 
84	<#assign  
85		linkText = '' 
86		linkTitle = '' 
87		linkSubText = '' 
88	 
89		linkUrl = cur_Document.getData() 
90		linkParams = 'target="_blank"' 
91		linkClass= 'link-download' 
92	/> 
93 
94	<#assign file = getDLFileEntry(cur_Document)> 
95 
96	<#assign 
97		linkText = file.getTitle() 
98		linkTitle = languageUtil.format(locale, "download-x", linkText, false) 
99		linkSubText = ' <span class="file-info">(' + file.getExtension()?upper_case + ', ' + formatFilesize(file.getSize())  + ')</span>' 
100	/> 
101 
102	<a class="link-icon ${linkClass}" href="${linkUrl}" title="${linkTitle}" ${linkParams}>${linkText} ${linkSubText}</a> 
103</#macro> 
104 
105<#function getDLFileEntryAltText Image> 
106	<#if Image.getAttribute("id")?? && Image.getAttribute("id") != ""> 
107		<#return ""> 
108	<#else> 
109		<#assign dlFileEntry = getDLFileEntry(Image) > 
110		<#return dlFileEntry.getDescription()/> 
111	</#if> 
112</#function> 
113 
114<#function getDLFileEntry fileEntry> 
115	<#assign dlFileEntry = ''> 
116	<#if fileEntry.getAttribute("fileEntryId")?? && fileEntry.getAttribute("fileEntryId") != ""> 
117		<#assign 
118		dlFileEntry = DLFileEntryService.getFileEntry(fileEntry.getAttribute("fileEntryId")?number) 
119		/> 
120	<#else> 
121		<#assign 
122		dlFileEntry = getDLFileEntryFromUrl(fileEntry.getData()) 
123		/> 
124	</#if> 
125	<#return dlFileEntry> 
126</#function> 
127 
128<#function getDLFileEntryFromUrl fileUrl> 
129	<#assign counter = 0 > 
130	<#list "${fileUrl}"?split("/") as pathSegemtent> 
131		<#if counter == 2> 
132			<#assign groupId = pathSegemtent?number > 
133		</#if> 
134		<#if counter == 5> 
135			<#assign subCounter = 0 > 
136			<#list "${pathSegemtent}"?split("?") as subSegemtent> 
137				<#if subCounter == 0> 
138					<#assign uuId = subSegemtent > 
139				</#if> 
140				<#assign subCounter = subCounter+1 > 
141			</#list> 
142		</#if> 
143		<#assign counter = counter+1 > 
144	</#list> 
145 
146	<#assign dlFileEntry = DLFileEntryService.getFileEntryByUuidAndGroupId(uuId,groupId) > 
147 
148	<#return dlFileEntry> 
149</#function> 
150 
151<#function formatFilesize fileSize> 
152	<#assign GB = 1000000000 /> 
153	<#assign MB = 1000000 /> 
154	<#assign KB = 1000 /> 
155 
156	<#if fileSize < MB > 
157		<#assign val = fileSize / 1000 /> 
158		<#return val?string("###,##0.#")+'KB' > 
159	<#elseif fileSize < GB > 
160		<#assign val = fileSize / 1000000 /> 
161		<#return val?string("###,##0.#")+'MB' > 
162	<#else> 
163		<#assign val = fileSize /> 
164		<#return val?string("###,##0.#")+'B' > 
165	</#if> 
166</#function> 
167 
168<#function formatDate dateString dateTimeFormat> 
169	<#-- Expects dateString to be RFC-822 date-time formatted--> 
170	<#assign dateStringPattern = "EEE, dd MMM yyyy HH:mm:ss Z"/> 
171 
172	<#assign dateItem = dateUtil.parseDate(dateStringPattern, dateString, localeUtil.getDefault())> 
173 
174	<#assign formatDateString = dateUtil.getDate(dateItem, dateTimeFormat, locale, timeZone)> 
175 
176	<#return formatDateString /> 
177</#function> 
178 
179<#macro initMediaValues> 
180<#-- If either one of the needed Media Types is not present create the Variable with an empty string --> 
181<#-- needed since some Articles might not have them --> 
182	<#if !Video??> 
183		<#assign Video = ''/> 
184	</#if> 
185	<#if !VideoFiles??> 
186		<#assign VideoFileEntry = ''/> 
187	<#else> 
188		<#assign 
189		VideoFileEntry = VideoFiles.VideoFileEntry 
190		/> 
191	</#if> 
192	<#if !Image??> 
193		<#assign Image = ''/> 
194	</#if> 
195</#macro> 
196 
197<#macro renderYoutubeVideo videoId> 
198	<iframe 
199			src="https://www.youtube-nocookie.com/embed/${videoId}?color=white&amp;controls=2&amp;hl=${locale.getLanguage()}&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0" 
200			frameborder="0" 
201			allow="autoplay; encrypted-media" 
202			allowfullscreen 
203	></iframe> 
204</#macro> 
205 
206<#macro renderVideoPlayer videoFiles videoPlayerId=randomNamespace> 
207	<#assign 
208	previewImage = '' 
209 
210	theme_path = themeDisplay.getPathThemeCss() 
211 
212	videojsCssPath = theme_path + '/theme/video-js/video-js.min.css' 
213	/> 
214 
215	<video id="media_teaser_video_${videoPlayerId}" class="video-js vjs-fluid vjs-big-play-centered video-js-bks"> 
216		<#list videoFiles.getSiblings() as videoFile> 
217			<#if videoFile.getData()?? && videoFile.getData() != ''> 
218				<#assign 
219				videoFileEntry = getFileEntryFromUrl(videoFile.getData()) 
220				mimeType = videoFileEntry.getMimeType() 
221				/> 
222				<#if previewImage == ''> 
223					<#assign 
224					previewImage = DLUtil.getImagePreviewURL(videoFileEntry, videoFileEntry.getFileVersion(), themeDisplay) 
225					/> 
226				</#if> 
227				<source src="${videoFile.getData()}" type="${mimeType}"> 
228			</#if> 
229		</#list> 
230		<p class="vjs-no-js">Um dieses Video anzusehen, aktivieren Sie bitte JavaScript, und verwenden Sie einen Browser der <a href="http://videojs.com/html5-video-support/" target="_blank">Videos im HTML5 Standard unterstützt.</a></p> 
231	</video> 
232 
233	<script> 
234		Liferay.Loader.require([ 
235					"videojs" 
236				], 
237				function(videojs) { 
238					var allCssElements=document.getElementsByTagName("link"); 
239					var cssAlreadyExists = false; 
240 
241					for (var i=allCssElements.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove 
242						if (allCssElements[i] && allCssElements[i].getAttribute("href")!=null && allCssElements[i].getAttribute("href").indexOf("${videojsCssPath}")!=-1){ 
243							cssAlreadyExists = true; 
244
245
246 
247					if (!cssAlreadyExists) { 
248						var newCssFile=document.createElement("link"); 
249						newCssFile.setAttribute("rel", "stylesheet"); 
250						newCssFile.setAttribute("type", "text/css"); 
251						newCssFile.setAttribute("href", "${videojsCssPath}"); 
252 
253						document.getElementsByTagName('head')[0].appendChild(newCssFile); 
254
255 
256					videojs('media_teaser_video_${videoPlayerId}', { 
257						controls: true, 
258						autoplay: false, 
259						preload: 'auto', 
260						aspectRatio: "16:9", 
261						fluid: 1, 
262						language: "${locale.getLanguage()}", 
263						poster: "${previewImage}" 
264					}); 
265 
266					Liferay.on('startNavigate', function() { 
267						videojs('media_teaser_video_${videoPlayerId}').dispose(); 
268					}); 
269				}, 
270				function(error) { 
271					console.error(error); 
272
273		); 
274	</script> 
275</#macro> 
276 
277<#-- Get FileEntry NOT DlFileEntry!!! --> 
278<#function getFileEntryFromUrl fileUrl> 
279	<#assign counter = 0 > 
280	<#list "${fileUrl}"?split("/") as pathSegemtent> 
281		<#if counter == 2> 
282			<#assign groupId = pathSegemtent?number > 
283		</#if> 
284		<#if counter == 5> 
285			<#assign subCounter = 0 > 
286			<#list "${pathSegemtent}"?split("?") as subSegemtent> 
287				<#if subCounter == 0> 
288					<#assign uuId = subSegemtent > 
289				</#if> 
290				<#assign subCounter = subCounter+1 > 
291			</#list> 
292		</#if> 
293		<#assign counter = counter+1 > 
294	</#list> 
295 
296	<#assign fileEntry = DLAppService.getFileEntryByUuidAndGroupId(uuId,groupId) > 
297 
298	<#return fileEntry> 
299</#function> 
300 
301<#function getYoutubeIdFromUrl url> 
302	<#assign pathSegments = "${url}"?split("/") > 
303	<#return pathSegments?last> 
304</#function> 
305 
306<#function getMediaTypeData Video VideoFileEntries Image> 
307	<#assign 
308	mediaTypeData = { 
309	"hasMedia" : false, 
310	"mediaType" : "", 
311	"mediaCssClass" : "" 
312
313	/> 
314	<#if Video?? && Video?has_content && Video.getData()?contains("youtube") || Video.getData()?contains("youtu.be")> 
315		<#assign 
316		mediaTypeData = { 
317		"hasMedia" : true, 
318		"mediaType" : "youtube", 
319		"mediaCssClass" : "media-element-fixed-width" 
320
321		/> 
322	<#elseif VideoFileEntries?? && VideoFileEntries?has_content && VideoFileEntries.getSiblings()?has_content> 
323		<#list VideoFileEntries.getSiblings() as videoFileEntryItem> 
324			<#if videoFileEntryItem.getData()?? && videoFileEntryItem.getData() != ''> 
325				<#assign 
326				mediaTypeData = { 
327				"hasMedia" : true, 
328				"mediaType" : "videofile", 
329				"mediaCssClass" : "media-element-fixed-width" 
330
331				/> 
332			</#if> 
333		</#list> 
334	</#if> 
335	<#if !mediaTypeData['hasMedia'] && Image?? && Image?has_content && Image.getData()?? && Image.getData() != ""> 
336		<#assign 
337		mediaTypeData = { 
338		"hasMedia" : true, 
339		"mediaType" : "image", 
340		"mediaCssClass" : "" 
341
342		/> 
343	</#if> 
344	<#return mediaTypeData/> 
345</#function> 
346 
347<#macro renderMedia Video VideoFileEntries Image mediaTypeData mediaId=randomNamespace> 
348	<#switch mediaTypeData['mediaType']> 
349		<#case 'youtube'> 
350			<#assign youtubeId = getYoutubeIdFromUrl(Video.getData()) /> 
351			<div class="aspect-ratio aspect-ratio-16-to-9 aspect-ratio-top"> 
352				<@renderYoutubeVideo youtubeId/> 
353			</div> 
354			<#break> 
355		<#case 'videofile'> 
356			<@renderVideoPlayer VideoFileEntries mediaId/> 
357			<#break> 
358		<#case 'image'> 
359			<#assign 
360			altText = Image.getAttribute("alt") 
361			/> 
362			<#if !Image.getAttribute("alt")?? || Image.getAttribute("alt") == ""> 
363				<#assign 
364				altText = getDLFileEntryAltText(Image) 
365				/> 
366			</#if> 
367			<img data-fileentryid="${Image.getAttribute("fileEntryId")}" alt="${altText}" src="${Image.getData()}" /> 
368			<#break> 
369	</#switch> 
370</#macro>