Archival fonds - Sona
Hero Image
An error occurred while processing the template.
The following has evaluated to null or missing:
==> numAssetTotali [in template "20101#20128#105176" at line 117, column 28]
----
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: #local numPage = (numAssetTotali / de... [in template "20101#20128#105176" in macro "paginazione" at line 117, column 9]
- Reached through: @paginazione [in template "20101#20128#105176" at line 88, column 17]
----
1<#assign portalUrl = portal.getPathFriendlyURLPublic() + themeDisplay.getLayout().getGroup().getFriendlyURL() />
2
3<!-- PARAMETRI PAGINAZIONE =============================================== -->
4
5<#assign delta = 20 />
6<#assign elencoURL = portal.getPathFriendlyURLPublic() + themeDisplay.getLayout().getGroup().getFriendlyURL() + themeDisplay.getLayoutFriendlyURL(layout) />
7
8<#assign portletId = renderRequest.getAttribute("PORTLET_ID") />
9
10<#if request.getParameter("_${portletId}_current")?has_content>
11 <#assign currentPage = request.getParameter("_${portletId}_current")?number />
12<#else>
13 <#assign currentPage = 1 />
14</#if>
15
16<!-- ============================================================================= -->
17
18
19<!-- BREADCRUMB -->
20<div class="container">
21 <nav aria-label="breadcrumb">
22 <ol class="breadcrumb">
23 <li class="breadcrumb-item">
24 <a href="${portalUrl}/home"
25 title="<@liferay_ui['message'] key='label.sona.breabcrumb.parte1' /> <@liferay_ui['message'] key='label.sona.fondiArchivio.elenco.title' />"
26 aria-label="<@liferay_ui['message'] key='label.sona.fondiArchivio.elenco.title' /> - <@liferay_ui['message'] key='label.sona.breabcrumb.parte1' /> <@liferay_ui['message'] key='label.sona.fondiArchivio.elenco.title' /> - <@liferay_ui['message'] key='label.sona.breabcrumb.parte2' />">
27 Home
28 </a>
29 </li>
30 <li class="breadcrumb-item active" aria-current="page"><@liferay_ui['message'] key='label.sona.fondiArchivio.elenco.title' /></li>
31 </ol>
32 </nav>
33</div>
34
35
36<section id="fondiArchivio">
37 <h2 class="text-center"><@liferay_ui['message'] key='label.sona.fondiArchivio.elenco.title' /></h2>
38
39 <div class="container">
40 <div class="row mr-n3 ml-n3">
41
42 <!-- LISTA NON VUOTA DISEGNO GLI ELEMENTI -->
43 <#if entries?has_content>
44
45 <!-- Determino il range di index da disegnare come card per la pagina corrente -->
46 <#assign _endRange = currentPage * delta />
47 <#assign _startRange = _endRange - delta />
48
49 <!-- Incremento il contatore delle cards per usarlo poi in fase di paginazione -->
50 <#assign numAssetTotali = entries?size />
51
52 <!-- -->
53 <#list entries as entry>
54 <!-- controllo sull'indice dell'i-esimo elemento se ricade nel range da mostrare per questa pagina -->
55 <#if (_startRange == entry?index || _startRange < entry?index) && entry?index < _endRange>
56
57 <#assign
58 assetRenderer = entry.getAssetRenderer()
59 document = saxReaderUtil.read(assetRenderer.getArticle().getContentByLocale(locale))
60
61 nomeFondo = document.valueOf("//*/dynamic-element[@name='nomeFondo']/dynamic-content/text()")
62
63 logo = document.valueOf("//*/dynamic-element[@name='logo']/dynamic-content/text()")
64 logoObj = jsonFactoryUtil.createJSONObject(logo)
65 logoURL = "/documents/" + logoObj.getString('groupId') + "/" + logoObj.getString('uuid')
66
67 dettaglioURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, entry, true)
68 dettaglioURL = dettaglioURL?keep_before("?")
69 />
70
71 <div class="col-12 col-sm-6 col-md-4 col-lg-2 box-card">
72 <div class="card" style="background: url('${logoURL}') no-repeat;margin-bottom: 20px!important;"></div>
73 <div>
74 <!-- Button Dettaglio -->
75 <a href="${dettaglioURL}" class="anchor--button" title="<@liferay_ui['message'] key='label.sona.fondiArchivio.elenco.approfondisci.title' arguments='${htmlUtil.escape(nomeFondo)}' />" aria-label="<@liferay_ui['message'] key='label.sona.fondiArchivio.elenco.approfondisci.ariaLabel' arguments='${htmlUtil.escape(nomeFondo)}' />">
76 ${nomeFondo}
77 </a>
78 <hr>
79 </div>
80 </div>
81 </#if>
82 </#list>
83 </#if>
84 </div><!-- .row -->
85 </div><!-- .container -->
86
87 <div class="container" id="containerPagination">
88 <@paginazione />
89 </div>
90
91</section>
92
93
94
95<!--
96 La funzione ritorna la url della pagina inclusiva degli eventuali filtri di ricerca.
97-->
98<#function getUriParameters>
99
100 <#local url = elencoURL + "?" />
101
102 <#local url = url + "p_p_id=" + portletId + "&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_r_p_resetCur=false&" + portletId + "_delta=" + delta + "&" />
103
104 <#return url>
105</#function>
106
107
108<!--
109 La funzione disegna la pulsantiera per la paginazione.
110-->
111<#macro paginazione>
112
113 <#local url = getUriParameters() />
114
115 <#local pagine_paginatore = 5 />
116
117 <#local numPage = (numAssetTotali/delta)?ceiling />
118 <#local page_start = (((currentPage/pagine_paginatore)?ceiling-1)*pagine_paginatore)+1 />
119 <#local page_stop = page_start+pagine_paginatore-1 />
120
121 <#if (page_start < 0 || page_start == 0)>
122 <#local page_start = 1 />
123 <#local page_stop = pagine_paginatore />
124 </#if>
125
126 <#if (page_stop > numPage)>
127 <#local page_stop = numPage />
128 </#if>
129
130 <#local nPrev = page_start-pagine_paginatore />
131 <#if (nPrev < 0 || nPrev == 0 )>
132 <#local nPrev= 1 />
133 </#if>
134
135 <#local nNext = page_stop + 1 />
136 <#if (currentPage > numPage-5 || currentPage > numPage-5)>
137 <#local nNext = numPage />
138 </#if>
139
140
141 <#if numPage > 0>
142
143 <nav class="pagination" aria-label="Page navigation">
144 <h2 class="sr-only">Paginazione</h2>
145
146 <ul>
147 <!-- PRIMA PAGINA -->
148 <li class="first <#if (page_start == 1)>disabled</#if>">
149 <a <#if (page_start != 1 )>href="${url}_${portletId}_current=1"</#if> title="<@liferay_ui['message'] key='label.sona.paginazione.primaPagina.title'/>" aria-label="<@liferay_ui['message'] key='label.sona.paginazione.primaPagina.ariaLabel'/>">
150 <span class="sr-only"><@liferay_ui["message"] key="label.sona.paginazione.primaPagina.title"/></span>
151 <span class="icon-campania-uikit-more_arrow_left"></span>
152 </a>
153 </li>
154
155 <!-- PREV 5 PAGINI -->
156 <li class="prev <#if page_start == 1>disabled</#if>">
157 <a <#if currentPage != 1>href="${url}_${portletId}_current=${nPrev}"</#if> title="<@liferay_ui['message'] key='label.sona.paginazione.prev.title'/>" aria-label="<@liferay_ui['message'] key='label.sona.paginazione.prev.ariaLabel'/>">
158 <span class="sr-only"><@liferay_ui["message"] key="label.sona.paginazione.prev.title"/></span>
159 <span data-brackets-id="64154" class="icon-campania-uikit-arrow_left"></span>
160 </a>
161 </li>
162
163 <!-- NUMERO PAGINA -->
164 <#list page_start..page_stop as x>
165 <#if x == currentPage>
166 <#assign classe="page active" />
167 <#else>
168 <#assign classe="page" />
169 </#if>
170 <li class="${classe}">
171 <a href="${url}_${portletId}_current=${x}" title="<@liferay_ui['message'] key='label.sona.paginazione.currentPage.title' arguments='${x}' />" aria-label="<@liferay_ui['message'] key='label.sona.paginazione.currentPage.ariaLabel' arguments='${x}' />">
172 <span class="sr-only"><@liferay_ui["message"] key="label.sona.paginazione.currentPage.title" arguments="${x}" /> </span>${x}
173 </a>
174 </li>
175 </#list>
176
177 <!-- NEXT 5 PAGINI -->
178 <li class="next <#if page_stop == numPage>disabled</#if>">
179 <a <#if page_stop != numPage>href="${url}_${portletId}_current=${nNext}"</#if> title="<@liferay_ui['message'] key='label.sona.paginazione.next.title'/>" aria-label="<@liferay_ui['message'] key='label.sona.paginazione.next.ariaLabel'/>">
180 <span class="sr-only"><@liferay_ui["message"] key="label.sona.paginazione.next.title"/></span>
181 <span data-brackets-id="64154" class="icon-campania-uikit-arrow_right"></span>
182 </a>
183 </li>
184
185 <!-- ULTIMA PAGINA -->
186 <li class="last <#if (page_stop == numPage)>disabled</#if>">
187 <a <#if (page_stop != numPage)>href="${url}_${portletId}_current=${numPage}"</#if> title="<@liferay_ui['message'] key='label.sona.paginazione.ultimaPagina.title'/>" aria-label="<@liferay_ui['message'] key='label.sona.paginazione.ultimaPagina.ariaLabel'/>">
188 <span class="sr-only"><@liferay_ui["message"] key="llabel.sona.paginazione.ultimaPagina.title"/></span>
189 <span class="icon-campania-uikit-more_arrow_right"></span>
190 </a>
191 </li>
192 </ul>
193
194 <div class="information">Pag. ${currentPage} <@liferay_ui['message'] key='label.sona.paginazione.di' /> ${numPage}</div>
195 </nav>
196 </#if>
197</#macro>