Lightmixer – LC Görlitz unterstützt Foto-Ausstellung

Fehler bei der Verarbeitung der Vorlage.
The following has evaluated to null or missing:
==> cur_section.images  [in template "10154#10194#LIONS_ARTICLE" at line 222, column 26]

----
Tip: It's the step after the last dot that caused this error, not those before it.
----
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 cur_section.images.getSiblings()?...  [in template "10154#10194#LIONS_ARTICLE" at line 222, column 21]
----
1<#assign 
2jsonFactoryUtil = staticUtil["com.liferay.portal.kernel.json.JSONFactoryUtil"] 
3dlFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") 
4lionsTemplateVideoService = serviceLocator.findService("de.lions.foundation.service.LionsVideoService") 
5lionsImageService = serviceLocator.findService("de.lions.foundation.service.LionsImageService") 
6namespace = themeDisplay.getPortletDisplay().getNamespace()!"" 
7imageUrlArray = [] 
8imgCntr = 0 
9/> 
10 
11<#macro renderImage 
12image 
13checkAspectRatio=false 
14alignLeft=false 
15
16    <#if image.getData()?has_content> 
17 
18        <@addFrescoImageUrl image.getData() /> 
19 
20        <#assign isPortrait =  false /> 
21        <#if checkAspectRatio> 
22            <#assign isPortrait = lionsImageService.isPortraitImage(image.getData()) /> 
23        </#if> 
24 
25        <#assign 
26        imageCssClass = "img-fluid crop-center" + isPortrait?then(""," position-absolute h-100 w-100") 
27        fileVersion = lionsImageService.getFileVersionFromWebContentString(image.data)!"" 
28        /> 
29 
30        <div class="image-wrapper ${isPortrait?then("portrait","aspect-ratio aspect-ratio-3-to-2 w-100")} ${alignLeft?then("mr-0 ml-auto", "")}"> 
31            <#if fileVersion?? && fileVersion?has_content> 
32                <@adaptive_media_image["img"] 
33                fileVersion=fileVersion 
34                class=imageCssClass 
35                alt=image.alt.getData() 
36                data\-image\-id=getNextId() /> 
37            <#else> 
38                <img class="${imageCssClass}" 
39                     src="${image.getData()}" 
40                     alt="${image.alt.getData()}" 
41                     data-img-id="${getNextId()}"> 
42            </#if> 
43        </div> 
44 
45        <@renderImageCaption image isPortrait alignLeft/> 
46    </#if> 
47</#macro> 
48 
49<#macro renderSlider 
50images 
51sliderNumber 
52additionalCccClass="" 
53showArrows=true 
54aspectRatioCssClass="aspect-ratio-3-to-2" 
55
56    <div class="swiper-container swiper-container-${namespace}-${sliderNumber} h-100 ${additionalCccClass}"> 
57        <div class="swiper-wrapper"> 
58            <#list images as cur_image> 
59 
60                <@addFrescoImageUrl cur_image.getData() /> 
61 
62                <#assign 
63                imageCssClass = "mx-auto d-block img-fluid w-100 h-100 crop-center" 
64                imageAlt = cur_image.alt?has_content?then(cur_image.alt.getData(), '') 
65                fileVersion = lionsImageService.getFileVersionFromWebContentString(cur_image.data)!"" 
66                /> 
67 
68                <div class="swiper-slide ${cur_image?is_first?then('active', '')}"> 
69                    <div class="aspect-ratio aspect-ratio-3-to-2"> 
70                        <#if fileVersion?? && fileVersion?has_content> 
71                            <@adaptive_media_image["img"] 
72                            fileVersion=fileVersion 
73                            class=imageCssClass 
74                            alt=imageAlt 
75                            data\-image\-id=getNextId() /> 
76                        <#else> 
77                            <img class="${imageCssClass}" 
78                                 src="${cur_image.getData()}" 
79                                 alt="${imageAlt}" 
80                                 data-img-id="${getNextId()}"> 
81                        </#if> 
82                    </div> 
83                    <@renderImageCaption cur_image /> 
84                </div> 
85            </#list> 
86        </div> 
87        <!-- Add Pagination --> 
88        <div class="swiper-pagination"></div> 
89        <!-- Add Arrows --> 
90        <div class="swiper-navigation-wrapper position-relative mx-auto h-100"> 
91            <div class="swiper-button-next"></div> 
92            <div class="swiper-button-prev"></div> 
93        </div> 
94    </div> 
95 
96 
97    <script type="text/javascript"> 
98        ${namespace}initSwiper('.swiper-container-${namespace}-${sliderNumber}', ${showArrows?c}); 
99    </script> 
100</#macro> 
101 
102<#macro renderImageCaption 
103image 
104isPortrait=false 
105alignLeft=false 
106
107    <#assign 
108    imageCaption = (image.caption?? && image.caption.getData()?has_content)?then(image.caption.getData(), "") 
109    imageSource = (image.source?? && image.source.getData()?has_content)?then(image.source.getData(), "") 
110    /> 
111 
112    <#if imageCaption?has_content || imageSource?has_content> 
113        <div class="image-caption mb-3 mb-md-0 ${isPortrait?then("portrait", "")} ${alignLeft?then("mr-0 ml-auto", "")}"> 
114            <#if imageCaption?has_content || imageSource?has_content> 
115                ${imageCaption} 
116            </#if> 
117            <#if imageSource?has_content> 
118                <span class="px-1">|</span> 
119            </#if> 
120            <#if imageSource?has_content> 
121                ${imageSource} 
122            </#if> 
123        </div> 
124    </#if> 
125</#macro> 
126 
127<#function getNextId > 
128    <#assign imgCntr = imgCntr + 1> 
129    <#return imgCntr> 
130</#function> 
131 
132<#macro addFrescoImageUrl url > 
133    <#assign imageUrlArray = imageUrlArray + [url] /> 
134</#macro> 
135 
136<#macro renderAttachments attachments> 
137    <#if attachments?? && attachments.documents??> 
138        <ul class="attachments mt-3"> 
139            <#list attachments.documents.getSiblings() as document> 
140                <#if document.data?has_content> 
141                    <#assign documentJson = jsonFactoryUtil.looseDeserialize(document.data) /> 
142                    <#if document.documentTitle.getData()?has_content> 
143                        <#assign docTitle = document.documentTitle.getData()> 
144                    <#elseif document.getData()?has_content> 
145                        <#assign docTitle = documentJson.title> 
146                    </#if> 
147 
148                    <#if docTitle?has_content> 
149                        <#assign fileEntry = dlFileEntryLocalService.fetchDLFileEntryByUuidAndGroupId(documentJson.uuid, getterUtil.getLong(documentJson.groupId))!"" > 
150                        <#if fileEntry?has_content> 
151                            <#assign fileSize = languageUtil.formatStorageSize(fileEntry.getSize(), themeDisplay.getLocale()) /> 
152                            <li> 
153                                <a data-type="${fileEntry.getMimeType()}" 
154                                   target="_blank" class="" 
155                                   href="${document.getData()}"> 
156                                    <img src="/o/lions-theme/images/file_system/small/${fileEntry.getIcon()}.png"/> 
157                                    &nbsp;${docTitle}&nbsp;(${fileSize}) 
158                                </a> 
159                            </li> 
160                        </#if> 
161                    </#if> 
162                </#if> 
163            </#list> 
164        </ul> 
165    </#if> 
166</#macro> 
167 
168<script type="text/javascript"> 
169    function ${namespace}initSwiper(selector, showArrows) { 
170        Liferay.Loader.require('lions-js-module-loader@1.0.0/third-party/swiper', function (obj) { 
171            let config = 
172
173                    slidesPerView: 'auto', 
174                    centeredSlides: true, 
175                    loop: true, 
176                    spaceBetween: 30, 
177                    pagination: { 
178                        el: '.swiper-pagination', 
179                        clickable: true, 
180                    }, 
181                }; 
182 
183            if (showArrows) { 
184                config.navigation = { 
185                    nextEl: '.swiper-button-next', 
186                    prevEl: '.swiper-button-prev', 
187                }; 
188
189 
190            let swiper = new obj(selector, config); 
191 
192        }, function (error) { 
193            console.error(error); 
194        }); 
195
196</script> 
197 
198<div class="container lions-article mt-4 variant-${variant.getData()}"> 
199    <#if variant.getData() == "1"> 
200        <div class="row justify-content-md-center mb-3 headline-row"> 
201            <div class="col-md-7"> 
202                <h1>${headline.getData()}</h1> 
203            </div> 
204        </div> 
205        <!-- Sections --> 
206        <#list sections.getSiblings() as cur_section> 
207            <div class="lions-article-contents"> 
208                <div class="row justify-content-md-center"> 
209                    <div class="col-md-7"> 
210                        <#if cur_section.subHeadline.getData()?has_content> 
211                            <h4>${cur_section.subHeadline.getData()}</h4> 
212                        </#if> 
213                        <#if cur_section.abstractSection.getData()?has_content> 
214                            <p class="abstract">${cur_section.abstractSection.getData()}</p> 
215                        </#if> 
216                        <#if cur_section.content.getData()?has_content> 
217                            <div>${cur_section.content.getData()}</div> 
218                        </#if> 
219                    </div> 
220                </div> 
221                <div class="row justify-content-md-center lions-article-images"> 
222                    <#if cur_section.images.getSiblings()?size == 1> 
223                        <div class="col-md-9"> 
224                            <@renderImage 
225                            image=cur_section.images.getSiblings()[0] 
226                            /> 
227                        </div> 
228                    <#elseif (cur_section.images.getSiblings()?size > 1)> 
229                        <div class="col-md-9 slider-col"> 
230                            <@renderSlider 
231                            images=cur_section.images.getSiblings() 
232                            sliderNumber=cur_section?index 
233                            additionalCccClass="lions-swiper-full-width" 
234                            /> 
235                        </div> 
236                    <#else> 
237                        <div class="col-md-12"> 
238                            <!-- no image --> 
239                        </div> 
240                    </#if> 
241                    <!-- Youtube Video --> 
242                    <#if cur_section.video?? && cur_section.video.getData()?has_content> 
243                        <#assign 
244                        videoEmbeddedCode = lionsTemplateVideoService.getVideoEmbeddedCode(cur_section.video.getData()) 
245                        /> 
246                        <#if videoEmbeddedCode?has_content> 
247                            <div class="col-md-9"> 
248                                <div class="video-box"> 
249                                    ${videoEmbeddedCode} 
250                                </div> 
251                            </div> 
252                        </#if> 
253                    </#if> 
254                </div> 
255            </div> 
256        </#list> 
257        <#if attachments??> 
258            <div class="row justify-content-md-center lions-article-attachments"> 
259                <div class="col-md-7"> 
260                    <#if attachments.attachmentSubHeadline?? && attachments.attachmentSubHeadline.getData()?has_content> 
261                        <h3>${attachments.attachmentSubHeadline.getData()}</h3> 
262                    </#if> 
263                    <@renderAttachments 
264                    attachments=attachments 
265                    /> 
266                </div> 
267            </div> 
268        </#if> 
269    <#elseif variant.getData() == "2"> 
270        <!-- variant 2 --> 
271        <div class="row justify-content-md-left headline-row"> 
272            <div class="col-md-6"> 
273                <h1>${headline.getData()}</h1> 
274            </div> 
275        </div> 
276        <!-- Sections --> 
277        <#list sections.getSiblings() as cur_section> 
278            <div class="row justify-content-md-left lions-article-contents"> 
279                <div class="col-md-6"> 
280                    <#if cur_section.subHeadline.getData()?has_content> 
281                        <h3>${cur_section.subHeadline.getData()}</h3> 
282                    </#if> 
283                    <#if cur_section.abstractSection.getData()?has_content> 
284                        <p class="abstract">${cur_section.abstractSection.getData()}</p> 
285                    </#if> 
286                    <#if cur_section.content.getData()?has_content> 
287                        <div>${cur_section.content.getData()}</div> 
288                    </#if> 
289                </div> 
290                <div class="col-md-6"> 
291                    <div class="row no-gutters justify-content-md-right lions-article-images"> 
292                        <#if cur_section.images.getSiblings()?size == 1 && cur_section.images.getSiblings()[0].getData()?has_content> 
293                            <@renderImage 
294                            image=cur_section.images.getSiblings()[0] 
295                            checkAspectRatio=true 
296                            /> 
297                        <#elseif (cur_section.images.getSiblings()?size > 1)> 
298                            <@renderSlider 
299                            images = cur_section.images.getSiblings() 
300                            sliderNumber=cur_section?index 
301                            additionalCccClass="lions-swiper-inline w-100" 
302                            /> 
303                        <#else> 
304                            <!-- no image --> 
305                        </#if> 
306                    </div> 
307                    <div class="row no-gutters justify-content-md-right lions-article-images"> 
308                        <!-- Youtube Video --> 
309                        <#if cur_section.video?? && cur_section.video.getData()?has_content> 
310                            <#assign 
311                            videoEmbeddedCode = lionsTemplateVideoService.getVideoEmbeddedCode(cur_section.video.getData()) 
312                            /> 
313                            <#if videoEmbeddedCode?has_content> 
314                                <div class="col-md-12"> 
315                                    <div class="video-box" 
316                                         style="${cur_section.images.getData()?has_content?then('', 'margin-top: 0;')}"> 
317                                        ${videoEmbeddedCode} 
318                                    </div> 
319                                </div> 
320                            </#if> 
321                        </#if> 
322                    </div> 
323                </div> 
324            </div> 
325            <#if cur_section?is_last && attachments??> 
326                <div class="row justify-content-md-left lions-article-contents"> 
327                    <div class="col-md-6"> 
328                        <#if attachments.attachmentSubHeadline?? && attachments.attachmentSubHeadline.getData()?has_content> 
329                            <h3>${attachments.attachmentSubHeadline.getData()}</h3> 
330                        </#if> 
331                        <@renderAttachments 
332                        attachments=attachments 
333                        /> 
334                    </div> 
335                </div> 
336            </#if> 
337        </#list> 
338    <#else> 
339        <!-- variant 3 --> 
340        <div class="row justify-content-md-left headline-row"> 
341            <div class="col-md-12"> 
342                <h1>${headline.getData()}</h1> 
343            </div> 
344        </div> 
345        <!-- Sections --> 
346        <#list sections.getSiblings() as cur_section> 
347            <div class="row justify-content-md-left lions-article-contents"> 
348                <div class="col-md-6"> 
349                    <div class="row no-gutters justify-content-md-right lions-article-images"> 
350                        <#if cur_section.images.getSiblings()?size == 1 && cur_section.images.getSiblings()[0].getData()?has_content> 
351                            <@renderImage 
352                            image=cur_section.images.getSiblings()[0] 
353                            checkAspectRatio=true 
354                            alignLeft=cur_section?is_even_item 
355                            /> 
356                        <#elseif (cur_section.images.getSiblings()?size > 1)> 
357                            <@renderSlider 
358                            images = cur_section.images.getSiblings() 
359                            sliderNumber=cur_section?index 
360                            additionalCccClass="lions-swiper-inline w-100" 
361                            /> 
362                        <#else> 
363                            <!-- no image --> 
364                        </#if> 
365                    </div> 
366                    <div class="row no-gutters justify-content-md-right lions-article-images"> 
367                        <!-- Youtube Video --> 
368                        <#if cur_section.video?? && cur_section.video.getData()?has_content> 
369                            <#assign 
370                            videoEmbeddedCode = lionsTemplateVideoService.getVideoEmbeddedCode(cur_section.video.getData()) 
371                            /> 
372                            <#if videoEmbeddedCode?has_content> 
373                                <div class="col-md-12"> 
374                                    <div class="video-box" 
375                                         style="${cur_section.images.getData()?has_content?then('', 'margin-top: 0;')}"> 
376                                        ${videoEmbeddedCode} 
377                                    </div> 
378                                </div> 
379                            </#if> 
380                        </#if> 
381                    </div> 
382                </div> 
383                <div class="col-md-6 ${cur_section?is_odd_item?then("order-md-first", "")}"> 
384                    <#if cur_section.subHeadline.getData()?has_content> 
385                        <h3>${cur_section.subHeadline.getData()}</h3> 
386                    </#if> 
387                    <#if cur_section.abstractSection.getData()?has_content> 
388                        <p class="abstract">${cur_section.abstractSection.getData()}</p> 
389                    </#if> 
390                    <#if cur_section.content.getData()?has_content> 
391                        <div>${cur_section.content.getData()}</div> 
392                    </#if> 
393                </div> 
394            </div> 
395            <#if cur_section?is_last && attachments??> 
396                <div class="row justify-content-md-left lions-article-contents"> 
397                    <div class="col-md-6"> 
398                        <#if attachments.attachmentSubHeadline?? && attachments.attachmentSubHeadline.getData()?has_content> 
399                            <h3>${attachments.attachmentSubHeadline.getData()}</h3> 
400                        </#if> 
401                        <@renderAttachments 
402                        attachments=attachments 
403                        /> 
404                    </div> 
405                </div> 
406            </#if> 
407        </#list> 
408    </#if> 
409</div> 
410 
411<link rel="stylesheet" type="text/css" href="${themeDisplay.getPathThemeCss()}/fresco.css"/> 
412 
413<script type="text/javascript"> 
414 
415    function getThumbnailUrl(url) { 
416        let pattern = new RegExp("(\\?|\\&)(imageThumbnail=).*?(&|$)"); 
417 
418        if (url && url.search(pattern) >= 0) { 
419            url = url.replace(pattern, "$1$3"); 
420
421        return url + ((url.indexOf('?') > -1) ? '&imageThumbnail=1' : '?imageThumbnail=1'); 
422
423 
424    function createImageElement(url) { 
425        let imageElement = {}; 
426        imageElement.url = url; 
427        imageElement.options = {}; 
428        imageElement.options.thumbnail = getThumbnailUrl(url); 
429        return imageElement; 
430
431 
432    Liferay.Loader.require('lions-js-module-loader@1.0.0/third-party/fresco', function (obj) { 
433 
434        let imageUrls = [<#list imageUrlArray as imageElement>'${imageElement}', </#list>] 
435 
436        let Fresco = obj; 
437        let frescoImages = []; 
438        imageUrls.forEach(url => frescoImages.push(createImageElement(url))); 
439 
440        // lightbox start 
441        $('#p_p_id${namespace} .lions-article img').click(function () { 
442            Fresco.show(frescoImages, $(this).data('img-id')); 
443        }); 
444        $('#p_p_id${namespace} .lions-article').addClass('lightbox'); 
445        // lightbox end 
446    }, function (error) { 
447        console.error(error); 
448    }); 
449 
450</script>