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