La raccolta nel tuo comune
Si è verificato un errore nell'elaborarazione del modello.
The following has evaluated to null or missing:
==> themeDisplay.getURLCurrent()?split('?comune=')[1] [in template "20099#20135#850909" at line 377, column 27]
----
Tip: It's the final [] step 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: #assign QScomune = themeDisplay.getUR... [in template "20099#20135#850909" at line 377, column 9]
----
1<#noparse>
2<script>
3// Funzione standalone per override completo di HERAcquaModena come se fosse Hera
4function overrideHERAcquaModenaAsHera() {
5 const selectedComuneServices = sessionStorage.getItem(
6 "selectedComuneServices"
7 )
8 ? JSON.parse(sessionStorage.getItem("selectedComuneServices"))
9 : getServicesForSelectedComune();
10
11 // Controlla se ci sono servizi disponibili
12 if (!selectedComuneServices || !selectedComuneServices.comune ||
13 selectedComuneServices.tipologieCliente.length === 0) {
14 return;
15 }
16
17 // Determina il tipo di cliente (Casa o Business)
18 const type = location.pathname.split("/").includes("casa") ? "Casa" : "Business";
19 const tipologiaCliente = selectedComuneServices.tipologieCliente.find(
20 (el) => el.nomeTipologia === type
21 );
22
23 if (!tipologiaCliente) return;
24
25 // Cerca se c'è almeno un servizio con HERAcquaModena
26 const hasHERAcquaModena = tipologiaCliente.serviziSocieta.some(
27 (el) => el.societa === "HERAcquaModena"
28 );
29
30 console.log("DEBUG Override - Ha HERAcquaModena:", hasHERAcquaModena);
31 console.log("DEBUG Override - Tutti i servizi:", tipologiaCliente.serviziSocieta);
32
33 // Override solo se c'è almeno un servizio HERAcquaModena
34 if (hasHERAcquaModena) {
35 console.log("DEBUG Override - Applicando override completo per HERAcquaModena");
36
37 // Forza la visualizzazione di TUTTI i menu come se fosse Hera
38 $(".verifycomunemenu").each(function (index) {
39 const menu = $(this).attr("data-menu");
40
41 // Lista dei menu principali da mostrare
42 const menuDaMostrare = [
43 "Richieste multiservizio",
44 "Acqua e Fognatura",
45 "Gas",
46 "Energia Elettrica",
47 "Teleriscaldamento"
48 ];
49
50 if (menuDaMostrare.includes(menu)) {
51 console.log("DEBUG Override - Forzando visualizzazione menu:", menu);
52 $(this).show();
53 $(this).removeClass("d-none");
54
55 // Assicurati che anche i sottomenu siano visibili
56 $(this).find(".verifycomunemenu").each(function() {
57 $(this).show();
58 $(this).removeClass("d-none");
59 });
60
61 // Rimuovi eventuali style="display: none" inline
62 $(this).css('display', '');
63 $(this).find(".verifycomunemenu").css('display', '');
64 }
65
66 // Gestione speciale per link senza data-menu ma con classi verifycomunemenu
67 if (!menu && $(this).hasClass("verifycomunemenu")) {
68 // Controlla se il parent ha un menu che dovrebbe essere visibile
69 const parentMenu = $(this).closest('[data-menu]').attr("data-menu");
70 if (menuDaMostrare.includes(parentMenu)) {
71 console.log("DEBUG Override - Forzando visualizzazione sottomenu di:", parentMenu);
72 $(this).show();
73 $(this).removeClass("d-none");
74 $(this).css('display', '');
75 }
76 }
77 });
78
79 // Override anche per elementi con data-menu="Ambiente" se presente
80 $('[data-menu="Ambiente"]').each(function() {
81 console.log("DEBUG Override - Forzando visualizzazione menu Ambiente");
82 $(this).show();
83 $(this).removeClass("d-none");
84 $(this).css('display', '');
85 });
86 }
87
88}
89
90// Auto-esecuzione al caricamento della pagina
91$(window).on('load', function() {
92 overrideHERAcquaModenaAsHera();
93});
94
95// Esegui anche dopo il cambio comune
96if (typeof initCallback !== 'undefined') {
97 const originalInitCallback = initCallback;
98 initCallback = function() {
99 originalInitCallback();
100 overrideHERAcquaModenaAsHera();
101 };
102}
103
104// Listener per cambio sessionStorage
105$(window).on('storage', function(e) {
106 if (e.originalEvent.key === 'selectedComuneServices') {
107 overrideHERAcquaModenaAsHera();
108 }
109});
110
111// Override delle funzioni esistenti che gestiscono i menu
112if (typeof showhidepanels !== 'undefined') {
113 const originalShowhidepanels = showhidepanels;
114 showhidepanels = function() {
115 const result = originalShowhidepanels.apply(this, arguments);
116 overrideHERAcquaModenaAsHera();
117 return result;
118 };
119}
120
121// Override anche per la funzione che gestisce i comuni
122$(document).on('click', '.inputcomune', function() {
123 setTimeout(function() {
124 overrideHERAcquaModenaAsHera();
125 }, 600);
126});
127
128// Override per eventi di selezione comune
129$(document).on('DOMSubtreeModified', function() {
130 const selectedComuneServices = sessionStorage.getItem("selectedComuneServices");
131 if (selectedComuneServices) {
132 const services = JSON.parse(selectedComuneServices);
133 if (services.comune && services.tipologieCliente) {
134 overrideHERAcquaModenaAsHera();
135 }
136 }
137});
138
139</script>
140</#noparse>
141
142
143
144<#assign colorbackground="" />
145<#if ColoreSezione.getData() !="" && ColoreSfondo.getData()!="#" && ColoreSfondo.getData()!="#00000">
146 <#assign colorbackground=ColoreSfondo.getData() />
147<#elseif ColoreSezione.getData() !="">
148 <#assign colorbackground=ColoreSezione.getData() />
149
150<#else>
151 <#assign colorbackground=ColoreSfondo.getData() />
152</#if>
153
154<#assign prefUrlCondividi=themeDisplay.getPortalURL() urlcustom=themeDisplay.getURLCurrent()?keep_before("?")
155currentURL=htmlUtil.escape(themeDisplay.getURLCurrent())
156assistenzaUrl="/assistenza" ambienteUrl="/ambiente" mobileMenuClass="" />
157
158<script>
159
160 var timeElapsed = 0;
161 var interval = setInterval(function() {
162 timeElapsed += 100;
163 $('li.text-decoration-underline').each(function() {
164 // Cerca il tag <a> con il testo "Comunicati stampa" all'interno del <li>
165 var link = $(this).find('a').filter(function() {
166 return $(this).text().trim() === 'Comunicati stampa';
167 });
168
169 // Se il tag <a> con il testo "Comunicati stampa" � trovato, rimuovi l'after
170 if (link.length > 0) {
171 $(this).css('content', 'none'); // Rimuovi l'after
172 }
173 });
174
175 var comunicatiLink = $('a').filter(function() {
176 return $(this).text().trim() === 'Comunicati stampa';
177 });
178
179 if (comunicatiLink.length > 0) {
180 comunicatiLink.closest('.col-10')
181 .siblings()
182 .remove();
183
184 clearInterval(interval);
185 }
186
187 if (timeElapsed >= 5000) {
188 clearInterval(interval);
189 }
190 }, 100);
191</script>
192
193<style>
194
195
196@media(max-width:769px){
197
198.tilewrapper.pl-5.pr-2 {
199 padding: 0!Important;
200}
201
202.tilewrapper li {
203 list-style: none!Important;
204}
205}
206
207 .modal.show .modal-dialog {
208 width: 60%;
209 }
210 .header-breadcrumb li.text-decoration-underline::after{
211 content: '>';
212 display: inline-block;
213 margin-right: 7px;
214 }
215 .testatabreadcrumb .offerta-modal {
216 z-index: 100;
217 display: block;
218 position: absolute;
219 height: max-content;
220 width: max-content;
221 right: 85px;
222 top: 80px;
223 box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
224 margin: 3px;
225 }
226 @media (max-width: 991px) {
227 .testatabreadcrumb .offerta-modal {
228 right: 30px;
229 top: 70px;
230 }
231 }
232 .testatabreadcrumb .offerta-modal-content {
233 background-color: #fefefe;
234 margin: auto;
235 padding: 20px;
236 border-radius: 0.75rem !important;
237 }
238 .testatabreadcrumb .close_offerta {
239 color: #aaa;
240 float: right;
241 font-size: 28px;
242 font-weight: bold;
243 }
244 .testatabreadcrumb .close_offerta:hover, .testatabreadcrumb .close_offerta:focus {
245 color: #000;
246 text-decoration: none;
247 cursor: pointer;
248 }
249 .testatabreadcrumb .close-icon {
250 position: absolute !important;
251 right: 20px;
252 top: 2px;
253 }
254 .testatabreadcrumb .social__wrapper {
255 list-style-type: none;
256 padding-left: 0;
257 }
258 .testatabreadcrumb .social__icon {
259 border: none;
260 border-radius: 50%;
261 padding: 8px;
262 width: 40px;
263 height: 40px;
264 cursor: pointer;
265 }
266 .testatabreadcrumb .social__title {
267 letter-spacing: 0.5px;
268 font-weight: 600;
269 }
270 .testatabreadcrumb .social__iconFacebook {
271 background-color: #3b5998;
272 color: #fff;
273 }
274 .testatabreadcrumb .social__iconLinkedIn {
275 background-color: #0e76a8;
276 color: #fff;
277 }
278 .testatabreadcrumb .social__iconTwitter {
279 background-color: black;
280 color: #fff;
281 }
282 .testatabreadcrumb .social__iconMail {
283 background-color: #018982;
284 color: #fff;
285 }
286 .testatabreadcrumb .social__iconCopyLink {
287 background-color: #018982;
288 color: #fff;
289 }
290 .testatabreadcrumb .social__iconWhatsapp {
291 background-color: #25d366;
292 color: #fff;
293 }
294 .testatabreadcrumb .fa-whatsapp:before {
295 content: "\f232";
296 }
297 .testatabreadcrumb .social__titleWrapper {
298 border: 0;
299 padding: 0;
300 background-color: transparent;
301 color: #018982;
302 cursor: pointer;
303 min-width: 81px;
304 }
305
306 .sharetext{
307color: white;
308margin-top: 14px;
309}
310</style>
311
312<#assign completeUrl=prefUrlCondividi + urlcustom />
313
314<script>
315
316 $(document).ready(function () {
317 $('#select-menu').click(function () {
318 if ($('#root-arrow').hasClass('icon-chevron-down')) {
319 $('#root-arrow').removeClass('icon-chevron-down');
320 $('#root-arrow').addClass('icon-chevron-up');
321 $('#select-menu .select-menu-container').addClass('open');
322 }
323 else {
324 $('#root-arrow').removeClass('icon-chevron-up');
325 $('#root-arrow').addClass('icon-chevron-down');
326 setTimeout(function () {
327 $('#select-menu .select-menu-container').removeClass('open');
328 }, 800);
329 }
330 });
331 });
332</script>
333<#assign nomepagina=themeDisplay.getLayout().getName(locale) />
334<#assign title=.vars['reserved-article-title'].data vocabularyId=0
335journalArticleServiceUtil=objectUtil("com.liferay.journal.service.JournalArticleServiceUtil")
336assetVocabularyServiceUtil=objectUtil("com.liferay.asset.kernel.service.AssetVocabularyLocalServiceUtil")
337vocabulariesList=assetVocabularyServiceUtil.getGroupVocabularies(themeDisplay.getScopeGroupId())
338journalArticle=journalArticleServiceUtil.getArticle(getterUtil.getLong(scopeGroupId),
339.vars['reserved-article-id'].data)
340assetCategoryServiceUtil=objectUtil("com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil")
341journalArticleCategories=assetCategoryServiceUtil.getCategories("com.liferay.journal.model.JournalArticle",
342journalArticle.getResourcePrimKey()) nomecomune=languageUtil.get(locale, "comune-generico" )
343comuniVar=languageUtil.get(locale, "COMUNI" ) yesVar=languageUtil.get(locale, "yesVar" )
344stringacondividi=languageUtil.get(locale, "stringacondividi" )
345stringachiusura=getterUtil.getString(themeDisplay.getThemeSetting("stringa-chiusura"))
346gruppoUrl=languageUtil.get(locale, "gruppo-internal-url" )
347gruppoEngUrl=languageUtil.get(locale, "gruppo-internal-eng-url" ) chiSiamoName=languageUtil.get(locale, "chi-siamo"
348) chiSiamoEngName=languageUtil.get(locale, "chi-siamo-eng" )
349offerteServiziUrl=languageUtil.get(locale, "offerte-internal-url" )
350assistenzaUrl=languageUtil.get(locale, "assistenza-internal-url" )
351assistenzaAmbienteUrl=languageUtil.get(locale, "ambiente-internal-url" ) fornitoriUrl="/fornitori"
352dlgblockVar="d-lg-block" trueVar="true" prefUrlCondividi=themeDisplay.getPortalURL()
353urlcustom=themeDisplay.getURLCurrent()?keep_before("?") />
354<#assign completeUrl=prefUrlCondividi + urlcustom />
355<#list vocabulariesList as vocabulary>
356 <#assign vocabularyName=vocabulary.getName() />
357 <#if vocabularyName==comuniVar>
358 <#assign vocabularyId=vocabulary.getVocabularyId() />
359 </#if>
360</#list>
361<#assign listcomuni=[] />
362<#list journalArticleCategories as category>
363 <#if category.vocabularyId==vocabularyId>
364 <#assign listcomuni=listcomuni + [category.name] />
365 </#if>
366</#list>
367<#list listcomuni as comune>
368 <#if (listcomuni?size gt 0)>
369 <#assign nomecomune=nomecomune +"@" + comune />
370 <#else>
371 <#assign nomecomune=comune />
372 </#if>
373</#list>
374<#assign selectedComune='' />
375<#if urlcustom?contains('/tariffa-puntuale') || urlcustom?contains('/ambiente/tari') || urlcustom?contains('/tributi-e-tariffe/tari') || urlcustom?contains('/tcp') || urlcustom?contains('/la-raccolta-nel-tuo-comune') || urlcustom?contains('/pulizia-strade')>
376 <#if themeDisplay.getURLCurrent()?matches('.*comune=.*')>
377 <#assign QScomune=themeDisplay.getURLCurrent()?split('?comune=')[1]?split('&')[0]/>
378 <#assign lista = assetCategoryServiceUtil.getCategories("com.liferay.portal.kernel.model.layout", themeDisplay.getLayout().getPrimaryKey())>
379 <#list lista as comune>
380 <#if heraContributorLocalService.normalize(comune.getName()) == heraContributorLocalService.normalize(QScomune)?upper_case>
381 <#assign selectedComune=comune.getName()?capitalize />
382 <#break>
383 </#if>
384 </#list>
385 <#elseif request.session.getAttribute('selectedComune')??>
386 <#assign selectedComune=request.session.getAttribute('selectedComune')?capitalize />
387 </#if>
388</#if>
389
390<#assign verifycomunemenu_class='' />
391<#if urlcustom?contains('/assistenza') || urlcustom?contains('/offerte-e-servizi/casa/ambiente')>
392 <#assign verifycomunemenu_class='verifycomunemenu' />
393</#if>
394
395
396
397<input type="hidden" name="nomecomune" value="${nomecomune}" />
398<div class="testatabreadcrumb bannershape position-relative" style="background-color:${colorbackground}">
399 <div class="container">
400 <div class="row">
401 <div class="col-lg-4 col-md-12">
402 <#assign actualUrl=themeDisplay.getLayout().getName(locale) breadcrumbName="" breadcrumbURLS=""
403 breadcrumb="" pageName="" pageNameUrl="" fulllayout="" breadcrumbNames=[] breadcrumbURLS=[]
404 idnumber=0 viewinmenu=true brothersviewmenu=[] currentindex=0 breadcrumbURL="" />
405 <#list themeDisplay.getLayout().getAncestors() as ancestor>
406 <#if (ancestor?index==0)>
407 <#assign
408 fulllayout=ancestor
409 publiclayout=fulllayout.isPublicLayout()
410 breadcrumbName=ancestor.getName(locale) breadcrumbURL=ancestor.getFriendlyURL()
411 breadcrumbNames +=[ancestor.getName(locale)]
412 />
413 </#if>
414 </#list>
415 <#assign breadcrumbNames=breadcrumbNames?reverse />
416 <#assign ancestorIndex=1 />
417 <#if breadcrumbURL?contains(gruppoUrl)>
418 <#if breadcrumbURL?contains(fornitoriUrl)>
419 <#assign ancestorIndex=3 />
420 <#else>
421 <#assign ancestorIndex=2 />
422 </#if>
423 <#elseif breadcrumbURL?contains(offerteServiziUrl)>
424 <#assign ancestorIndex=3 />
425 <#elseif breadcrumbURL?contains(assistenzaUrl)>
426 <#if breadcrumbURL?contains(assistenzaAmbienteUrl)>
427 <#assign ancestorIndex=3 />
428 <#else>
429 <#assign ancestorIndex=2 />
430 </#if>
431 <#elseif breadcrumbURL?contains("investorNews")>
432 <#if breadcrumbURL?contains("edizioni")>
433 <#assign ancestorIndex=4 />
434 <#else>
435 <#assign ancestorIndex=3 />
436 </#if>
437 </#if>
438 <#list themeDisplay.getLayout().getAncestors()?reverse as ancestor>
439 <#if (ancestor?index==ancestorIndex)>
440 <#assign fulllayout=ancestor />
441 <#break />
442 </#if>
443 </#list>
444 <#if fulllayout !="">
445 <#assign pageName=fulllayout.getName(locale) pageNameUrl=fulllayout.getFriendlyURL() />
446 </#if>
447 <#if TitoloBanner?? && (TitoloBanner.getData()?lower_case?trim==chiSiamoName?lower_case?trim ||
448 TitoloBanner.getData()?lower_case?trim==chiSiamoEngName?lower_case?trim)>
449 <#list fulllayout.getChildren() as ancestor>
450 <#if ancestor.getName(locale)?lower_case?trim==chiSiamoName?lower_case?trim ||
451 ancestor.getName(locale)?lower_case?trim==chiSiamoEngName?lower_case?trim>
452 <#assign fulllayout=ancestor pageName=fulllayout.getName(locale)
453 pageNameUrl=fulllayout.getFriendlyURL() />
454 <#break />
455 </#if>
456 </#list>
457 </#if>
458 <#if MostraMenuLaterale.getData()==dlgblockVar>
459 <#list fulllayout.getChildren() as children>
460 <#assign brotherschildnames=[] />
461 <#assign brotherschildurls=[] />
462 <#assign brothersviewmenu +=[children.getExpandoBridge().getAttribute("VisualizzabileInMenu")
463 ] />
464 <#list children.getChildren() as brotherschild>
465 <#assign brotherschildnames +=[brotherschild.getName(locale)] brotherschildurls
466 +=[brotherschild.getFriendlyURL()] />
467 </#list>
468 <#assign breadcrumbURL=layout.getGroup().getDisplayURL(themeDisplay, false) +
469 children.getName(locale) />
470 <#assign
471 assetVocabularyServiceUtil=objectUtil("com.liferay.asset.kernel.service.AssetVocabularyServiceUtil")
472 pageVocabularies=assetVocabularyServiceUtil.getGroupVocabularies(themeDisplay.getScopeGroupId(), "COMUNI"
473 , -1, -1, null)
474 assetCategoryServiceUtil=objectUtil("com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil")
475 pageCategories=assetCategoryServiceUtil.getCategories("com.liferay.portal.kernel.model.layout",
476 children.getPrimaryKey()) cssPageCategories="" pageVocabularyId=0 />
477 <#if pageVocabularies?size gt 0>
478 <#list pageVocabularies as pageVocabulary>
479 <#assign pageVocabularyId=pageVocabulary.getVocabularyId() />
480 </#list>
481 <#if pageCategories?size gt 0>
482 <#list pageCategories as pageCategory>
483 <#if pageCategory.getVocabularyId()==pageVocabularyId>
484 <#assign cssPageCategories +="@" + pageCategory.getName() />
485 </#if>
486 </#list>
487 </#if>
488 </#if>
489 <#if brotherschildnames?size !=0>
490 <#if brothersviewmenu[currentindex]?c==trueVar>
491 <#assign
492 isArrowDown=""
493 isItemOnCurrentParentText = ""
494 singleItemName = children.getName(locale)
495 currentPageName = themeDisplay.getLayout().getName(locale)
496 shouldFilterOnChildItem = "true"
497 menuStyle=""
498 />
499 <#if currentPageName?lower_case==singleItemName?lower_case>
500 <#assign
501 menuStyle="font-weight: 600"
502 iconChevron="icon-chevron-down"
503 collapse="collapse show"
504 shouldFilterOnChildItem = "false"
505 />
506 </#if>
507 <#if shouldFilterOnChildItem = "true">
508 <#list breadcrumbNames as breadcrumbName>
509 <#if breadcrumbName == singleItemName>
510 <#assign
511 isItemOnCurrentParentText = "true"
512 />
513 </#if>
514 </#list>
515
516 <#if isItemOnCurrentParentText == "true">
517 <#list children.getChildren() as brotherschild>
518 <#if actualUrl==brotherschild.getName(locale) || themeDisplay.getLayout().getName(locale) == brotherschild.getName(locale)>
519 <#assign iconChevron="icon-chevron-down" collapse="collapse show" isArrowDown="true"/>
520 </#if>
521 </#list>
522 </#if>
523
524 <#if isArrowDown != "true">
525 <#assign menuStyle="" iconChevron="icon-chevron-right" collapse="collapse" />
526 </#if>
527 </#if>
528 <#assign breadcrumbURLLink="<li><div class=\" dropdown px-2 py-2 ${verifycomunemenu_class}
529 ${cssPageCategories}\" data-menu=\"${children.getName(locale)}\">
530 <div class='row'>
531 <div class='col-10'><a class='d-inline pointer greyish-brown normal2'
532 style='${menuStyle}' href='" + children.getFriendlyURL() + "'>"
533 breadcrumbURLLink += children.getName(locale) + "</a></div>"
534 />
535 <#-- breadcrumbURLLink +="<div class='col-1'><div id='submenu_" + idnumber
536 + "' class=' pointer ${iconChevron} dropdown-toggle d-inline greyish-brown normal2' role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'></div>"
537 breadcrumbURLLink
538 +="<div style='top:-30px!important;' class='ml-4 dropdown-menu white' labelledby='submenu_"
539 + idnumber + "'>" idnumber=idnumber+1 -->
540 <#assign idArrowSubmenu=children.getName(locale)?replace(" ", "
541 -")?replace(",", "" )?replace(":", "" )?lower_case?trim
542 idnumber=idnumber+1 show_submenu=false />
543 <#list children.getChildren() as brotherschild>
544 <#if
545 brotherschild.getExpandoBridge().getAttribute("VisualizzabileInMenu")>
546 <#if
547 brotherschild.getExpandoBridge().getAttribute("VisualizzabileInMenu")?c==trueVar>
548 <#assign show_submenu=true />
549 </#if>
550 </#if>
551 <#if show_submenu>
552 <#break />
553 </#if>
554 </#list>
555 <#if show_submenu>
556 <#assign breadcrumbURLLink
557 +="<div class='col-1' ><div class='arrow-submenu pointer ${iconChevron} dropdown-toggle d-inline greyish-brown normal2' role='button' tabindex='0' aria-label='Espandi ${children.getName(locale)}' data-toggle='collapse' id='arrow-submenu-${idArrowSubmenu}' data-target='#submenu-${idnumber}' aria-haspopup='true' aria-expanded='false'></div></div>"
558 breadcrumbURLLink
559 +="<div class='col-11 pl-4 ${collapse}' id='submenu-" + idnumber
560 + "'><ul class='list-unstyled' style='list-style: none; padding: 0;'>" />
561 <#list children.getChildren() as brotherschild>
562 <#if
563 brotherschild.getExpandoBridge().getAttribute("VisualizzabileInMenu")>
564 <#assign
565 assetVocabularyServiceUtil=objectUtil("com.liferay.asset.kernel.service.AssetVocabularyServiceUtil")
566 pageVocabularies=assetVocabularyServiceUtil.getGroupVocabularies(themeDisplay.getScopeGroupId(), "COMUNI"
567 , -1, -1, null)
568 assetCategoryServiceUtil=objectUtil("com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil")
569 pageCategories=assetCategoryServiceUtil.getCategories("com.liferay.portal.kernel.model.layout",
570 brotherschild.getPrimaryKey()) cssPageCategories=""
571 pageVocabularyId=0 />
572 <#if pageVocabularies?size gt 0>
573 <#list pageVocabularies as pageVocabulary>
574 <#assign
575 pageVocabularyId=pageVocabulary.getVocabularyId() />
576 </#list>
577 <#if pageCategories?size gt 0>
578 <#list pageCategories as pageCategory>
579 <#if
580 pageCategory.getVocabularyId()==pageVocabularyId>
581 <#assign cssPageCategories +="@" +
582 pageCategory.getName() />
583 </#if>
584 </#list>
585 </#if>
586 </#if>
587 <#assign isItemOnCurrentParentText = "false" />
588 <#list breadcrumbNames as breadcrumbName>
589 <#if breadcrumbName == singleItemName>
590 <#assign
591 isItemOnCurrentParentText = "true"
592 />
593 </#if>
594 </#list>
595 <#assign menuStyle="" />
596 <#if actualUrl==brotherschild.getName(locale) && isItemOnCurrentParentText == "true">
597 <#assign menuStyle="font-weight: 600" />
598 </#if>
599 <#assign brotherschildname=brotherschild.getName(locale)
600 brotherschildurl=brotherschild.getFriendlyURL()
601 breadcrumbURLLink +="<li><a class=\" d-block pointer
602 greyish-brown normal2 px-1 py-1 ${verifycomunemenu_class}
603 ${cssPageCategories}\" data-menu=\"${children.getName(locale)}\" style='${menuStyle}'
604 href='" + brotherschildurl + "'>" +
605 brotherschildname + "</a></li>"
606 />
607 </#if>
608 </#list>
609 <#else>
610 <#assign breadcrumbURLLink
611 +="<div class='col-11 pl-4 ${collapse}' id='submenu-" + idnumber
612 + "'><ul class='list-unstyled' style='list-style: none; padding: 0;'>" />
613 </#if>
614 <#assign breadcrumbURLLink +="</ol></div></div></div></li>" />
615 <#assign breadcrumb=breadcrumb + breadcrumbURLLink />
616 </#if>
617 <#else>
618 <#if brothersviewmenu[currentindex]?c==trueVar>
619 <#assign menuStyle="" />
620 <#if actualUrl==children.getName(locale)>
621 <#assign menuStyle="font-weight: 600" />
622 </#if>
623 <#assign breadcrumbURLLink="<li><a class=\" d-block col-10 greyish-brown
624 normal2 px-2 py-2 verifycomunemenu ${cssPageCategories}\"
625 data-menu=\"${children.getName(locale)}\" style='${menuStyle}' href='" + children.getFriendlyURL() + "'>" +
626 children.getName(locale) + "</a></li>"
627 breadcrumb = breadcrumb + breadcrumbURLLink
628 />
629 </#if>
630 </#if>
631 <#assign currentindex=currentindex+1 />
632 </#list>
633 </#if>
634 <#assign breadcrumbBuckup=breadcrumb />
635 <div class="container sidemenucontent ${MostraMenuLaterale.getData()}">
636 <div class="tile" id="menu-laterale">
637 <div class="tile-content">
638 <div class="tilewrapper">
639 <nav aria-label="Navigazione ${pageName}">
640 <ul class='list-unstyled' style="list-style: none; padding: 0; margin:0;">
641 <li>
642 <a class="${ColoreTesto.getData()}" href="${pageNameUrl}">
643 <p class="bolder greyish-brown normal2 px-2 text-uppercase">${pageName}</p>
644 </a>
645 <hr class="my-3 mx-2">
646 </li>
647
648 ${breadcrumb}
649 </ul>
650 </nav>
651 </div>
652 </div>
653 </div>
654 </div>
655 </div>
656 <div class="col-lg-7 col-md-10 col-sm-10 col-xs-8">
657 <#assign actualUrl="<li class='actualurlbread ${ColoreTesto.getData()}'>" +
658 themeDisplay.getLayout().getName(locale) + "</li>" breadcrumbNames=[] breadcrumbURLS=[]
659 rightAngleBracket="<span class='right-angle-bracket ${ColoreTesto.getData()}'> > </span>"
660 breadcrumb="" />
661 <#list themeDisplay.getLayout().getAncestors() as ancestor>
662 <#assign breadcrumbNames +=[ancestor.getName(locale)] breadcrumbURLS
663 +=[ancestor.getFriendlyURL()] />
664 </#list>
665 <#assign breadcrumbNames=breadcrumbNames?reverse breadcrumbURLS=breadcrumbURLS?reverse />
666 <#list breadcrumbNames as breadcrumbName>
667 <#if breadcrumbName !="Super Homepage">
668 <#assign menuStyle="" />
669 <#if actualUrl==breadcrumbName>
670 <#assign menuStyle="font-weight: 600" />
671 </#if>
672 <#assign breadcrumbIndex=breadcrumbName?index breadcrumbURL=breadcrumbURLS[breadcrumbIndex]
673 breadcrumbURL=layout.getGroup().getDisplayURL(themeDisplay, false) + breadcrumbURL
674 breadcrumbURLLink="<li class='text-decoration-underline'><a class='${ColoreTesto.getData()} pr-2' style='${menuStyle}' href='" + breadcrumbURL
675 + "'>" + breadcrumbName + "</a></li>" breadcrumb=breadcrumb + breadcrumbURLLink/>
676 <#if (ancestorIndex + 1)==breadcrumbName?index>
677 <#assign idSubmenuArrow=breadcrumbName?string?replace(" ", " -")?replace(",", "" )?replace(":", ""
678 )?lower_case?trim />
679 <script>
680 var id = String("${idSubmenuArrow}");
681 var arrowId = "#arrow-submenu-" + id;
682 var submenu="#submenu-" + id;
683 if($(submenu) && $(submenu).length > 0) {
684 $(submenu).click(() => {
685 if ($(submenu).hasClass('icon-chevron-right')) {
686 $(submenu).removeClass('icon-chevron-right');
687 $(submenu).addClass('icon-chevron-down');
688 } else {
689 $(submenu).removeClass('icon-chevron-down');
690 $(submenu).addClass('icon-chevron-right');
691 }
692 });
693 }
694
695 </script>
696 </#if>
697 </#if>
698 </#list>
699 <#assign breadcrumb=breadcrumb + actualUrl />
700 <div class="pb-4">
701 <h1 id="pagename" class="${ColoreTesto.getData()} title-bigger bold pt-4 pt-md-2 pt-lg-5 mb-2">
702 ${htmlUtil.unescape(TitoloBanner.getData())}
703 <#if selectedComune??>
704 ${selectedComune}
705 </#if>
706 </h1>
707 <#if TestoAggiuntivo??>
708 <#if TestoAggiuntivo.getData() !="">
709 <p class="${ColoreTesto.getData()} normal bold">${TestoAggiuntivo.getData()}</p>
710 </#if>
711 </#if>
712 <#if (MostraBreadcrumb.getData()==yesVar)>
713 <nav class="header-breadcrumb ${ColoreTesto.getData()}" aria-label="Percorso di navigazione"><ol class="d-flex flex-wrap" style='list-style: none; padding: 0;'>${breadcrumb}
714
715 <#if selectedComune??>
716 <span class="white">${selectedComune}</span>
717 </#if>
718 </ol>
719 </nav>
720
721 </#if>
722 </div>
723 </div>
724 <div class="col-lg-1 col-md-2 col-sm-2 col-xs-4">
725 <div class="text-center float-right">
726 <div class="position-relative">
727 <button id="myButtonShare" class="pointer bg-transparent border-0" style="display:none;">
728 <p class="${ColoreTesto.getData()} title-bigger bold pt-lg-5 pt-4"></p>
729 <img alt=""
730 src="/o/gruppohera-theme/images/share-heart-${ColoreTesto.getData()}.png" />
731 <p class="sharetext black">${stringacondividi}</p>
732 </button>
733 <div id="myModalBreadcrumb" class="offerta-modal" style="min-width: 240px; display: none">
734 <div class="offerta-modal-content position-relative">
735 <div class="float-right">
736 <span id="close_offerta" class="close_offerta text-right close-icon">×</span>
737 </div>
738 <p class="h4 text-left mb-3 greyish-brown">Condividi</p>
739 <ul class="social__wrapper">
740 <li class="d-flex align-items-center mb-2">
741 <div class="mr-2" style="width: 40px; height: 40px;"><span
742 class="social__icon d-flex align-items-center justify-content-center icon-facebook social__iconFacebook"></span>
743 </div><a class="h6 mb-0 greyish-brown" id="facebook_share" href=""
744 target="_blank" style="font-size: 1.1rem;color: #018982;">Facebook</a>
745 </li>
746 <li class="d-flex align-items-center mb-2">
747 <div class="mr-2" style="width: 40px; height: 40px;"><span
748 class="social__icon d-flex align-items-center justify-content-center icon-linkedin social__iconLinkedIn"></span>
749 </div><a class="h6 mb-0 greyish-brown position-relative" id="linkedin_share"
750 href="" target="_blank" style="font-size: 1.1rem;color: #018982;">
751 LinkedIn
752 <div style="opacity: 0;top:0;" class="position-absolute w-100">
753 <script src="https://platform.linkedin.com/in.js"
754 type="text/javascript">lang: it_IT</script>
755 <script type="IN/Share"
756 data-url="https://www.gruppohera.it${currentURL}"></script>
757 </div>
758 </a>
759 </li>
760 <li class="d-flex align-items-center mb-2">
761 <div class="mr-2" style="width: 40px; height: 40px;"><img src="/documents/688182/0/logo-white-x.png/82ded04f-f3ee-3f23-e167-ed8a0cc95913?t=1707295919187"
762 class="social__icon d-flex align-items-center justify-content-center social__iconTwitter"></img>
763 </div><a class="h6 mb-0 greyish-brown" id="twitter_share" href=""
764 target="_blank" style="font-size: 1.1rem;color: #018982;">X</a>
765 </li>
766 <li class="d-flex align-items-center mb-2">
767 <div class="mr-2" style="width: 40px; height: 40px;">
768 <span
769 class="social__icon d-flex align-items-center justify-content-center social__iconWhatsapp text-left">
770 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
771 fill="#fff" viewBox="0 0 24 24">
772 <path
773 d="M.057 24l1.687-6.163c-1.041-1.804-1.588-3.849-1.587-5.946.003-6.556 5.338-11.891 11.893-11.891 3.181.001 6.167 1.24 8.413 3.488 2.245 2.248 3.481 5.236 3.48 8.414-.003 6.557-5.338 11.892-11.893 11.892-1.99-.001-3.951-.5-5.688-1.448l-6.305 1.654zm6.597-3.807c1.676.995 3.276 1.591 5.392 1.592 5.448 0 9.886-4.434 9.889-9.885.002-5.462-4.415-9.89-9.881-9.892-5.452 0-9.887 4.434-9.889 9.884-.001 2.225.651 3.891 1.746 5.634l-.999 3.648 3.742-.981zm11.387-5.464c-.074-.124-.272-.198-.57-.347-.297-.149-1.758-.868-2.031-.967-.272-.099-.47-.149-.669.149-.198.297-.768.967-.941 1.165-.173.198-.347.223-.644.074-.297-.149-1.255-.462-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.521.151-.172.2-.296.3-.495.099-.198.05-.372-.025-.521-.075-.148-.669-1.611-.916-2.206-.242-.579-.487-.501-.669-.51l-.57-.01c-.198 0-.52.074-.792.372s-1.04 1.016-1.04 2.479 1.065 2.876 1.213 3.074c.149.198 2.095 3.2 5.076 4.487.709.306 1.263.489 1.694.626.712.226 1.36.194 1.872.118.571-.085 1.758-.719 2.006-1.413.248-.695.248-1.29.173-1.414z" />
774 </svg>
775 </span>
776 </div>
777 <a class="h6 mb-0 greyish-brown" id="whatsApp_social" href="" target="_blank"
778 style="font-size: 1.1rem;color: #018982;">WhatsApp</a>
779 </li>
780 <li class="d-flex align-items-center mb-2">
781 <div class="mr-2" style="width: 40px; height: 40px;"><span
782 class="social__icon d-flex align-items-center justify-content-center icon-mail social__iconMail"></span>
783 </div><a class="h6 mb-0 greyish-brown"
784 href="https://mail.google.com/mail/?view=cm&fs=1&to=someone@example.com&su=Gruppo Hera&body=https://www.gruppohera.it${themeDisplay.getLayout().getFriendlyURL()}"
785 target="_blank" style="font-size: 1.1rem;color: #018982;">Email</a>
786 </li>
787 <li class="d-flex align-items-center mb-2">
788 <div class="mr-2" style="width: 40px; height: 40px;"><span
789 class="social__icon d-flex align-items-center justify-content-center icon-link social__iconCopyLink"></span>
790 </div><button
791 class="h6 mb-0 greyish-brown pointer bg-transparent border-0 social__titleWrapper text-left"
792 id="copyShareLinkButton" target="_blank"
793 style="font-size: 1.1rem;color: #018982;" onclick="copyShareLink()">Copia il
794 link</button>
795 </li>
796 </ul>
797 </div>
798 </div>
799 </div>
800 </div>
801 </div>
802 </div>
803 </div>
804</div>
805<#if currentURL?contains(assistenzaUrl)>
806 <#if currentURL?contains(ambienteUrl)>
807 <#assign mobileMenuClass="selectMenu__absolutePosition mb-4" />
808 <#else>
809 <#assign mobileMenuClass="" />
810 </#if>
811 <section id="assistenzamenu">
812 <div class="d-block d-lg-none mx-auto w-sm-75 w-md-100 px-4 ${mobileMenuClass} pt-4 pt-md-0">
813 <a id="select-menu" data-toggle="collapse" href="#collapse-menu-laterale" role="button" aria-expanded="true"
814 aria-controls="collapse-menu-laterale">
815 <div class="select-menu-container mt-2 bg-white">
816 <span class="text-uppercase color-gray">Assistenza</span>
817 <div id="root-arrow" class="icon-chevron-down root-arrow float-right mr-2 h-100"
818 style="/*writing-mode: vertical-lr;*/"></div>
819 </div>
820 </a>
821 <div class="collapse mx-4" id="collapse-menu-laterale">
822 <div class="py-3">
823 <div class="tilewrapper pl-5 pr-2">
824 ${breadcrumbBuckup}
825 </div>
826 </div>
827 </div>
828 </div>
829 </section>
830</#if>
831<script>
832
833 var shareModal = document.getElementById("myShareModal");
834 var shareBtn = document.getElementById("myShareBtn");
835 var shareCloseSpan = document.getElementsByClassName("my-share-close")[0];
836 var shareCloseBtn = document.getElementsByClassName("my-share-close-btn")[0];
837
838 if (shareBtn !== null) {
839 shareBtn.onclick = function() {
840 shareModal.style.display = "block";
841 $( "#copyShareLinkButton" ).prop( "disabled", false );
842 }
843 }
844
845 if (shareCloseSpan!==undefined && shareCloseSpan!="" && shareCloseSpan!== null){
846 shareCloseSpan.onclick = function() {
847 shareModal.style.display = "none";
848 $("#myShareCopiedToClipboard").remove();
849 }
850
851 shareCloseBtn.onclick = function() {
852 shareModal.style.display = "none";
853 $("#myShareCopiedToClipboard").remove();
854 $(".social__titleWrapper").text("Copia il link");
855 $(".social__titleWrapper").prop("disabled", false);
856 }
857 }
858
859 /* copy share link event */
860 function copyShareLink() {
861 navigator.clipboard.writeText(window.location.href);
862 $(".social__titleWrapper").text("Link Copiato!");
863 $(".social__titleWrapper").prop("disabled", true);
864 };
865
866 /* share social medial modal events */
867 var modal = document.getElementById("myModalBreadcrumb");
868 var btnShare = document.getElementById("myButtonShare");
869 var span = document.getElementById("close_offerta");
870
871 if (btnShare !== undefined && btnShare !== null) {
872 btnShare.onclick = function () {
873 console.log("cliccato")
874 modal.style.display = "block";
875 $("#copyLinkButton").prop("disabled", false);
876 }
877 }
878
879 // When the user clicks on <span> (x), close the modal
880 if (span !== undefined && span !== null) {
881 span.onclick = function () {
882 modal.style.display = "none";
883 $("#copiedToClipboard").remove();
884 $(".social__titleWrapper").text("Copia il link");
885 $(".social__titleWrapper").prop("disabled", false);
886 }
887 }
888 /* --share social medial modal events-- */
889
890 window.onclick = function(event) {
891 if (event.target == shareModal) {
892 shareModal.style.display = "none";
893 }
894 }
895
896
897 //Gestione Composizione Link Share Social
898 var url = window.location.href.includes("auth") ? window.location.href.replace("https://auth-", "https://") : window.location.href;
899 var encodedUri = encodeURI(url);
900
901 //LINKEDIN
902 function createLinkedinLink(url) {
903 var shareLink = "https://www.linkedin.com/shareArticle?mini=true&";
904 shareLink += "url=" + encodeURIComponent(url);
905 return shareLink;
906 }
907 var linkedinAncor = $("#linkedin_share");
908 linkedinAncor.attr("href", createLinkedinLink(encodedUri))
909
910 //FACEBOOK
911 function createFbShareLink(url) {
912 var shareLink = 'https://www.facebook.com/sharer/sharer.php?kid_directed_site=0&';
913 shareLink += 'u=' + encodeURIComponent(url);
914 shareLink += '&display=popup&ref=plugin&src=share_button';
915 return shareLink;
916 }
917 var facebookAncor = $("#facebook_share");
918 facebookAncor.attr("href", createFbShareLink(encodedUri));
919
920 //TWITTER
921 function createTwitterShareLink(url, title){
922 var shareLink = 'https://twitter.com/intent/tweet?';
923 shareLink += 'url=' + encodeURIComponent(url);
924 shareLink += '&text=' + 'Gruppo Hera -' + title;
925 return shareLink;
926 }
927 var twitterAncor = $("#twitter_share");
928 twitterAncor.attr("href", createTwitterShareLink(encodedUri, $("#pagename").text()));
929
930 //WHATSAPP
931 var whatsAppAncor = $("#whatsApp_social");
932 whatsAppAncor.attr("href", "https://wa.me/?text=" + encodeURIComponent(encodedUri));
933 /* ------ FINE GESTIONE SOCIAL ------ */
934
935 document.addEventListener('DOMContentLoaded', function() {
936 function getHashParam() {
937 return window.location.hash.substring(1).split(/[?&]/)[0];
938 }
939
940 function showAccordion($collapse) {
941 // L'elemento potrebbe essere sparito nel frattempo (DOM ricostruito):
942 // senza questo controllo $collapse.offset() e' undefined e .top esplode.
943 if (!$collapse || !$collapse.length) {
944 console.warn("showAccordion: collapse non piu' presente nel DOM");
945 return;
946 }
947 var collapseId = $collapse.attr("id");
948 var isOpen = $collapse.hasClass("show") || $collapse.hasClass("in");
949 var toggle = document.querySelector('[data-target="#' + collapseId + '"]');
950
951 // Apri passando dal toggle: così è Bootstrap a gestire lo stato del
952 // collapse e l'onclick (showHideItems) sincronizza le icone +/-.
953 // Aprire a mano con addClass lasciava le icone sfasate e impediva
954 // la successiva richiusura.
955 if (!isOpen && toggle) {
956 toggle.dispatchEvent(new MouseEvent("click", {
957 bubbles: true,
958 cancelable: true,
959 view: window
960 }));
961 }
962
963 var offset = $collapse.offset();
964 if (offset) {
965 $("html, body").animate({
966 scrollTop: offset.top - 20
967 }, 400);
968 }
969 }
970
971 function openAccordion(collapseId) {
972 // rimuove il cancelletto iniziale se c'è
973 collapseId = (collapseId || "").replace(/^#/, "");
974
975 // id vuoto o mancante: niente da aprire, evita $("#") che e' un
976 // selettore invalido.
977 if (!collapseId) {
978 console.warn("openAccordion: id accordion mancante nell'hash");
979 return;
980 }
981
982 // Selettore sicuro: escape dei caratteri speciali cosi' anche se
983 // nell'id restasse un simbolo non valido jQuery non lancia
984 // "unrecognized expression".
985 var safeSelector = "#" + ($.escapeSelector ? $.escapeSelector(collapseId) : collapseId);
986
987 var settleTimer = null;
988 var found = false;
989
990 // L'accordion viene (ri)costruito più volte: apri solo quando
991 // il DOM si è stabilizzato, cioè dopo l'ultima manipolazione.
992 function tryOpenWhenSettled() {
993 var $el = $(safeSelector);
994 if (!($el.length && $el.hasClass("collapse"))) {
995 return;
996 }
997 found = true;
998 // elemento presente: rimanda l'apertura finché il DOM continua a cambiare
999 clearTimeout(settleTimer);
1000 settleTimer = setTimeout(function () {
1001 observer.disconnect();
1002 // Ri-query al momento dell'apertura: tra il settle e adesso
1003 // un rebuild puo' aver rimosso momentaneamente l'elemento.
1004 var $target = $(safeSelector);
1005 if (!$target.length) {
1006 // assenza transitoria: rimettiti in ascolto e riprova
1007 found = false;
1008 observer.observe(document.body, { childList: true, subtree: true });
1009 return;
1010 }
1011 console.log("---> accordion stabilizzato, apro", collapseId);
1012 showAccordion($target);
1013 }, 1000);
1014 }
1015
1016 var observer = new MutationObserver(tryOpenWhenSettled);
1017 observer.observe(document.body, { childList: true, subtree: true });
1018
1019 // Controllo iniziale nel caso sia già presente
1020 tryOpenWhenSettled();
1021
1022 // Sicurezza: smette di osservare dopo 10s
1023 setTimeout(function () {
1024 observer.disconnect();
1025 if (!found) {
1026 console.warn("openAccordion: nessun accordion con id '" + collapseId + "' trovato entro 10s");
1027 }
1028 }, 10000);
1029 }
1030
1031 const accordionParam = getHashParam();
1032
1033 if (accordionParam) {
1034 console.log("parametro esistente", accordionParam)
1035 openAccordion(accordionParam);
1036 }
1037 });
1038
1039</script>
HeraAssetPublisherFilterComuneSelector
Aggregatore Risorse
Risparmiamo energia, insieme.
Il sito è in modalità risparmio energetico per ridurre i consumi, basta un click per ripartire.
Clicca in un punto qualsiasi per continuare a navigare