Eventi polveri sahariane
Si è verificato un errore nell'elaborarazione del modello.
The following has evaluated to null or missing: ==> null [in template "20155#20195#757170" at line 82, column 48] ---- 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: #assign myFileEntry = null [in template "20155#20195#757170" at line 82, column 25] ----
1<#-- Impostazioni globali -->
2<#setting url_escaping_charset='UTF-8'>
3
4<#-- Import classi -->
5<#assign DLAppLocalServiceUtil = staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"] />
6<#assign ddmFieldLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMFieldLocalService") />
7<#assign anni = ["2025", "2024", "2023", "2022", "2021", "2020", "2019", "2018", "2017", "2016", "2015", "2014"] />
8
9<section class="u-background-grey-10">
10 <#if entries?has_content>
11 <div class="accordion" id="accordionAnni">
12 <#list anni as annoCorrente>
13 <#assign isFirst = (annoCorrente_index == 0) />
14 <#assign count = 0 />
15
16 <#list entries as curEntry>
17 <#assign article = curEntry.getAssetRenderer().getArticle() />
18 <#assign ddmForm = article.getDDMStructure().getDDMForm() />
19 <#assign ddmFormValues = ddmFieldLocalService.getDDMFormValues(ddmForm, article.getId()) />
20 <#assign ddmFormFieldValues = ddmFormValues.getDDMFormFieldValues() />
21
22 <#assign anno = "" />
23 <#list ddmFormFieldValues as field>
24 <#if field.getFieldReference() == "anno">
25 <#assign anno = field.getValue().getString(locale) />
26 </#if>
27 </#list>
28
29 <#if anno == annoCorrente>
30 <#assign count++ />
31 </#if>
32 </#list>
33
34 <#if count gt 0>
35 <div class="accordion-item">
36 <div class="accordion-header" data-target="content_${annoCorrente}">
37 Eventi ${annoCorrente} <span style="font-weight: normal; font-size: 0.9rem;">(${count})</span>
38 </div>
39 <div id="content_${annoCorrente}" class="accordion-content <#if isFirst>open</#if>">
40 <div class="container accessibility-grid-wrapper">
41 <#list entries as curEntry>
42 <#assign renderer = curEntry.getAssetRenderer() />
43 <#assign article = renderer.getArticle() />
44 <#assign ddmForm = article.getDDMStructure().getDDMForm() />
45 <#assign ddmFormValues = ddmFieldLocalService.getDDMFormValues(ddmForm, article.getId()) />
46 <#assign ddmFormFieldValues = ddmFormValues.getDDMFormFieldValues() />
47
48 <#assign anno = "" />
49 <#assign imgmin = "" />
50 <#assign documento = "" />
51 <#assign docObj = {} />
52 <#assign entryTitle = htmlUtil.escape(renderer.getTitle(locale)) />
53
54 <#list ddmFormFieldValues as field>
55 <#switch field.getFieldReference()>
56 <#case "anno">
57 <#assign anno = field.getValue().getString(locale) />
58 <#break>
59 <#case "immagine">
60 <#assign imgObj = jsonFactoryUtil.createJSONObject(field.getValue().getString(locale)) />
61 <#if imgObj.url??>
62 <#assign imgmin = imgObj.url />
63 </#if>
64 <#break>
65 <#case "documento">
66 <#assign docObj = jsonFactoryUtil.createJSONObject(field.getValue().getString(locale)) />
67 <#if docObj.url??>
68 <#assign documento = docObj.url />
69 </#if>
70 <#break>
71 </#switch>
72 </#list>
73
74 <#if anno == annoCorrente>
75 <div class="accessibility-row">
76 <div class="grid-item">
77 <#if imgmin?has_content>
78 <img src="${imgmin}" alt="${entryTitle}" style="width: 100%; max-height: 250px; object-fit: contain;" />
79 </#if>
80 </div>
81 <div class="grid-item" style="font-size: 1rem;">
82 <#assign myFileEntry = null />
83 <#if docObj?? && docObj.uuid?? && docObj.groupId?? && docObj.uuid?has_content && docObj.groupId?has_content>
84 <#assign myFileEntry = DLAppLocalServiceUtil.getFileEntryByUuidAndGroupId(docObj.uuid, docObj.groupId?number) />
85 </#if>
86
87 <#if myFileEntry??>
88 <a href="/documents/${myFileEntry.getGroupId()}/${myFileEntry.getFolderId()}/${myFileEntry.getTitle()?url('UTF-8')}/${myFileEntry.getUuid()}" target="_blank">
89 ${entryTitle}
90 </a>
91 <#elseif documento?has_content>
92 <a href="${documento}" target="_blank">${entryTitle}</a>
93 </#if>
94 </div>
95 </div>
96 </#if>
97 </#list>
98 </div>
99 </div>
100 </div>
101 </#if>
102 </#list>
103 </div>
104 </#if>
105</section>
106
107<script>
108document.addEventListener("click", function (event) {
109 const header = event.target.closest(".accordion-header");
110 if (header) {
111 const targetId = header.getAttribute("data-target");
112 const content = document.getElementById(targetId);
113 if (content) {
114 content.classList.toggle("open");
115 }
116 }
117});
118</script>