Archivio Fotografico
Archivio Fotografico
Si è verificato un errore nell'elaborarazione del modello.
Can't convert this string to number: "archivio-fotografico?p_p_id=com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_8mo8BgdxI9cF&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_r_p_categoryId=0" The blamed expression: ==> currentPageFriendlyUrl?number [in template "20115#20151#71646" at line 33, column 88] ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign assetCategory = assetCategory... [in template "20115#20151#71646" at line 33, column 25] ----
1<!-- Archivio Fotografico Dettaglio STAGE-->
2
3<#assign vocabularyTerritori = 60238 >
4<#assign vocabularyFotoTag = 66603 >
5<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")>
6<#assign dlFileEntryService = serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService') />
7<#assign assetCategoryService = serviceLocator.findService('com.liferay.asset.kernel.service.AssetCategoryLocalService') />
8
9<div class="container row box-header-row">
10 <div class="col-md-8 col-sm-12 box-header-col">
11 <div class="row row-breadcrumb">
12 <#assign VOID = freeMarkerPortletPreferences.setValue("portletSetupPortletDecoratorId", "barebone" ) />
13 <@liferay_portlet["runtime"] instanceId="P6OQosvOETK1" portletName="com_liferay_site_navigation_breadcrumb_web_portlet_SiteNavigationBreadcrumbPortlet" defaultPreferences=freeMarkerPortletPreferences.getPreferences(freeMarkerPortletPreferences) />
14 <#assign VOID = freeMarkerPortletPreferences.reset()>
15 </div>
16
17 <div>
18 <#assign currentPageFriendlyUrl = themeDisplay.getURLCurrent()>
19 <#assign vocabularyId = '' />
20 <#assign title = '' />
21
22 <#if currentPageFriendlyUrl?contains('idVoc') >
23 <#assign vocabularyId = currentPageFriendlyUrl?split('=')?last?number>
24 <#if vocabularyId == vocabularyFotoTag >
25 <#assign title = 'Tutte le categorie' />
26 <#else>
27 <#assign title = 'Tutti i territori' />
28 </#if>
29
30 <#else>
31 <#assign splitter = currentPageFriendlyUrl?split("/") >
32 <#assign currentPageFriendlyUrl = splitter?last >
33 <#assign assetCategory = assetCategoryService.getAssetCategory(currentPageFriendlyUrl?number)>
34 <#assign vocabularyId = assetCategory.getVocabularyId()>
35 <#assign title = assetCategory.getName() />
36 </#if>
37
38 <#assign listCategoryVoc = assetCategoryService.getVocabularyCategories(vocabularyId, -1, -1, null)>
39 <#assign listCategory = '' >
40 <#assign titleGallery = ''>
41
42 <#if vocabularyId == vocabularyTerritori >
43 <#assign listCategory = assetCategoryService.getVocabularyCategories(vocabularyFotoTag, -1, -1, null)>
44 <#assign titleGallery = 'del territorio'>
45 <#else>
46 <#assign listCategory = assetCategoryService.getVocabularyCategories(vocabularyTerritori, -1, -1, null)>
47 <#assign titleGallery = 'della categoria'>
48 </#if>
49 <h1>
50 Fotogallery ${titleGallery}
51 <div class="title">
52 ${title}
53 </div>
54 </h1>
55
56 <#assign categoryList = '' />
57 <#list entries as curEntry>
58 <#assign uuid = curEntry.getClassUuid()>
59 <#assign groupid = curEntry.getGroupId()>
60 <#assign file = dlFileEntryService.getFileEntryByUuidAndGroupId(uuid, groupid?number) />
61 <#assign assetEntry=assetEntryLocalService.getEntry("com.liferay.document.library.kernel.model.DLFileEntry", file.fileEntryId) />
62 <#assign assetRenderer=assetEntry.assetRenderer />
63 <#assign docUrl=assetRenderer.getURLDownload(themeDisplay) />
64 <#assign category = assetEntry.getCategories() />
65
66 <#list category as catImg>
67 <#if listCategory?seq_contains(catImg) && !categoryList?contains(catImg.categoryId?string)>
68 <#if categoryList == '' >
69 <#assign categoryList = catImg.categoryId?string />
70 <#else>
71 <#assign categoryList = categoryList + ',' + catImg.categoryId?string />
72 </#if>
73 </#if>
74 </#list>
75 </#list>
76
77 <#if categoryList != ''>
78 <p>
79 <strong>
80 <#if vocabularyId == vocabularyFotoTag >
81 Territori:
82 <#else>
83 Altre categorie:
84 </#if>
85 </strong>
86 </p>
87
88 <#assign categorySplit = categoryList?split(',') />
89 <#list categorySplit as c>
90 <#if !c?is_first>
91 -
92 </#if>
93 <a href="javascript:void(0)" id="${c?number}" class="click-category">
94 ${assetCategoryService.getCategory(c?number).name}
95 </a>
96 </#list>
97 </#if>
98 </div>
99 </div>
100</div>
101<div class="container row gallery-row">
102 <#if entries?size == 0>
103 <h3 style="padding-top: 30px">Non ci sono immagini da visualizzare</h3>
104 </#if>
105 <#if entries?has_content>
106 <#assign currEntryPosition = 1 >
107 <#assign show = 9 >
108 <#assign entriesSize = entries?size >
109 <#assign counter = 0 />
110 <#list entries as curEntry>
111 <#assign noDisplay = "display-none" >
112 <#assign uuid = curEntry.getClassUuid()>
113 <#assign groupid = curEntry.getGroupId()>
114 <#-- ${curEntry.getTitle(locale)} -->
115 <#assign file = dlFileEntryService.getFileEntryByUuidAndGroupId(uuid, groupid?number) />
116 <#assign assetEntry=assetEntryLocalService.getEntry("com.liferay.document.library.kernel.model.DLFileEntry", file.fileEntryId) />
117 <#assign assetRenderer=assetEntry.assetRenderer />
118 <#assign docUrl=assetRenderer.getURLDownload(themeDisplay) />
119 <#assign category = assetEntry.getCategories() />
120
121 <#assign index = 0 >
122 <#list category as cat >
123 <#if listCategoryVoc?seq_contains(cat) >
124 <#assign index = index + 1 />
125 </#if>
126 </#list>
127
128
129 <#if category?size gt 0 && index gt 0>
130 <#if counter lt 9>
131 <#assign counter = counter + 1 />
132 <#assign noDisplay = "" >
133 </#if>
134
135 <div class="col-md-4 col-sm-6 col-img first-cat ${noDisplay}
136 <#list category as cat >
137 <#if listCategory?seq_contains(cat) >
138 cat_${cat.categoryId}
139 </#if>
140 </#list>
141 ">
142 <div style="width: 100%">
143 <div type="button" data-toggle="modal" data-target="#imgFotogalleryModale" data-fileimageurl='${docUrl}' data-descriptionfotogallery="${curEntry.getDescription()}" class="modal-img">
144 <img src="${docUrl}">
145 </div>
146 <div class="img-category-div">
147 <p class="img-category-name">
148 <#list category as c>
149 <#if c?is_first>
150 ${c.name}
151 <#else>
152 , ${c.name}
153 </#if>
154 </#list>
155 </p>
156 </div>
157 </div>
158 </div>
159 <#assign currEntryPosition = currEntryPosition + 1 >
160 </#if>
161 </#list>
162 <div id="imgFotogalleryModale" class="modal fade hiddenModal" tabindex="-1" role="dialog" aria-labelledby="fileInfoModalLabel" aria-hidden="true" >
163 <div class="modal-dialog">
164
165 <!-- Modal content -->
166 <div class="modal-content">
167 <div class="modal-body">
168 <img id="selected-file-image" class="img-responsive" alt="" data-fileentryid="" src="" />
169 </div>
170
171 <div class="modal-footer">
172 <span id="description-fotogallery-img">
173
174 </span>
175 </div>
176 </div>
177 </div>
178 </div>
179
180
181 <#assign noDisplayButton = "" >
182 <#if entriesSize?number lte counter>
183 <#assign noDisplayButton = "display-none" >
184 </#if>
185 <div class="container" style="display: flex; justify-content: center;">
186 <a href="javascript:show_more_result();" class="">
187 <div id="showMoreImgButton" class="link-fotogallery ${noDisplayButton}">
188 <div class="more-img-btn">
189 vedi altre foto
190 </div>
191 </div>
192 </a>
193 </div>
194 </#if>
195</div>
196
197<script>
198// JS Modale
199$(document).ready(function() {
200
201 $('#imgFotogalleryModale').on('hide.bs.modal', function() {
202 var modal = $('#imgFotogalleryModale')
203 modal.addClass('hiddenModal');
204 })
205
206 $('#imgFotogalleryModale').on('show.bs.modal', function(event) {
207 var modal = $('#imgFotogalleryModale');
208 modal.removeClass('hiddenModal');
209 var button = $(event.relatedTarget) // Button that triggered the modal
210 var imgUrl = button.data('fileimageurl') // Extract info from data-* attributes
211
212 var description = button.data('descriptionfotogallery');
213 $('#description-fotogallery-img').text(description);
214
215 modal.find('#selected-file-image').attr('src', imgUrl);
216 });
217});
218</script>
219
220<script>
221$(document).ready(function() {
222 $("a[class*='click-category']").click(function(){
223 var id = $(this).attr('id');
224 // console.log(id);
225 $("div[class*='first-cat']").addClass('display-none');
226
227 if ($(".cat_" + id).length <= 9) {
228 $( '#showMoreImgButton' ).addClass('display-none');
229 $(".cat_" + id).removeClass('display-none');
230 } else {
231 $(".cat_" + id).each(function(index){
232 // console.log(index);
233 if (index >= 0 && index <= 2) {
234 // console.log('prova');
235 $(this).removeClass('display-none');
236 };
237 });
238 $('#showMoreImgButton').removeClass('display-none');
239 $('#showMoreImgButton .more-img-btn').attr('id', "catFilter_" + id);
240 };
241 });
242});
243
244function show_more_result() {
245
246 //prendo l'id della categoria su cui io ho cliccato
247 if ($('.more-img-btn').attr('id') != null) {
248 var classCat = $('.more-img-btn').attr('id').split('_')[1];
249
250 //controllo e stampo 9 alla volta le immagini con quella categoria, se non ce ne sono più nascondo il bottone
251 $('.display-none.cat_' + classCat).each(function(index, item) {
252 if (index < 9) {
253 $(item).removeClass('display-none');
254 }
255 });
256 if ($('.display-none.cat_' + classCat).length == 0) {
257 $('#showMoreImgButton').addClass('display-none');
258 }
259
260 } else {
261
262 //controllo e stampo 9 alla volta le immagini, se non ce ne sono più nascondo il bottone
263 $('.display-none.first-cat').each(function(index, item) {
264 if (index < 9) {
265 $(item).removeClass('display-none');
266 }
267 });
268 hiddenCardList = $('.display-none.first-cat');
269 hiddenCardNumber = hiddenCardList.length;
270 if (hiddenCardNumber == 0 ) {
271 $('#showMoreImgButton').addClass('display-none');
272 }
273 }
274};
275</script>
276
277
278<style>
279 .taglib-categorization-filter.entry-title {
280 display: none;
281 }
282 .box-header-col {
283 border-top: 3px solid #2e2e2e;
284 background-color: #FFF;
285 padding: 0 40px;
286 padding-bottom: 20px;
287 }
288 .box-header-col .title {
289 font-size: 60px;
290 font-weight: bold;
291 }
292 .gallery-row, .box-header-row {
293 margin: 0 auto !important;
294 }
295 .box-header-row {
296 margin-bottom: 50px !important;
297 padding-left: 0;
298 }
299 .gallery-row {
300 background-color: #FFF;
301 padding: 0 40px 40px 40px;
302 }
303 .gallery-row img {
304 width: 100%;
305 height: 177px;
306 object-fit: cover;
307 }
308 .col-img {
309 display: flex;
310 justify-content: center;
311 margin-top: 40px;
312 }
313 .img-category-div {
314 background: #323232;
315 height: 65px;
316 display: flex;
317 align-items: center;
318 color: #FFF;
319 border-left: 5px solid #bbcf2f;
320 }
321 .img-category-name {
322 padding: 0 15px;
323 margin-bottom: 0px;
324 }
325 .display-none {
326 display: none !important;
327 }
328 .link-fotogallery {
329 border: 2px solid #2e2e2e;
330 padding: 8px;
331 border-radius: 4px;
332 width: 180px;
333 font-weight: 700;
334 text-align: center;
335 margin-left: auto;
336 margin-right: auto;
337 margin-top: 40px;
338 }
339 .container a:hover, .container a:focus {
340 text-decoration: none !important;
341 }
342 .more-img-btn {
343 color: #2e2e2e;
344 text-decoration: none !important;
345 }
346 .container #showMoreImgButton:hover {
347 background-color: #2e2e2e;
348 }
349 .container #showMoreImgButton:hover .more-img-btn {
350 color: white;
351 }
352 .link-fotogallery a {
353 text-decoration: none;
354 }
355
356/* Modale */
357 .modal-img {
358 cursor: pointer;
359 }
360 #selected-file-image {
361 height: auto;
362 }
363 #imgFotogalleryModale {
364 display: flex;
365 justify-content: center;
366 align-items: center;
367 }
368 #imgFotogalleryModale .modal-dialog {
369 width: auto;
370 margin: 10px;
371 }
372 #imgFotogalleryModale .modal-content {
373 max-width: 800px;
374 }
375 .hiddenModal {
376 display: none !important;
377 }
378 #description-fotogallery-img {
379 float: right;
380 font-size: 12px;
381 }
382</style>