1<#setting locale="it_IT">
2
3<#assign siteBaseURL = themeDisplay.getPortalURL() + themeDisplay.getPathFriendlyURLPublic() + themeDisplay.getLayout().getGroup().getFriendlyURL() />
4<#assign DLFileEntryLocalServiceUtil = staticUtil["com.liferay.document.library.kernel.service.DLFileEntryLocalServiceUtil"] />
5<#assign imagePath = themeDisplay.getTheme().getContextPath() + themeDisplay.getTheme().getImagesPath() />
6<#assign AssetVocabularyServiceUtil = staticUtil["com.liferay.asset.kernel.service.AssetVocabularyServiceUtil"]>
7<#assign AssetCategoryLocalServiceUtil = staticUtil["com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil"]>
8<#assign UserLocalServiceUtil = staticUtil["com.liferay.portal.kernel.service.UserLocalServiceUtil"]>
9<#assign GroupLocalServiceUtil = staticUtil["com.liferay.portal.kernel.service.GroupLocalServiceUtil"]>
10<#assign DLFolderLocalServiceUtil = staticUtil["com.liferay.document.library.kernel.service.DLFolderLocalServiceUtil"]>
11<#assign DLAppLocalServiceUtil = staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]>
12
13
14<div class="rt-wrapper">
15 <div class="rt-container">
16 <section class="rt-section rt-section--grid rt-section--grid-3" aria-label="">
17 <div class="rt-section-title-wrapper">
18 <h2 class="rt-section-title">
19 <i aria-hidden="true" class="fas fa-image"></i>
20 Gallerie fotografiche
21 </h2>
22 </div>
23 <div class="rt-section__wrapper">
24 <#if entries?has_content>
25 <#list entries as curEntry>
26 <#assign assetRenderer = curEntry.getAssetRenderer() />
27 <#assign className = assetRenderer.getClassName() />
28
29 <#assign rendererURL = siteBaseURL + "/-/" + assetRenderer.getUrlTitle() />
30
31 <#if className = "com.liferay.journal.model.JournalArticle" >
32 <#assign article = assetRenderer.getArticle() />
33 <#if article?? >
34 <#assign docXml = saxReaderUtil.read(article.getContent()) />
35
36 <#assign titleText = curEntry.getTitle(locale) />
37 <#assign titleLength = titleText?length />
38
39 <#if (titleLength > 92) >
40 <#assign titleText = titleText?substring(0,92) />
41 <#assign titleText = titleText + "..." />
42 </#if>
43
44 <#assign fileUrl = "" />
45 <#assign altImg = "" />
46
47 <#assign FolderPath = docXml.valueOf("//dynamic-element[@name='folder_path']/dynamic-content/text()") />
48 <#if FolderPath?? && FolderPath != "">
49
50 <#assign FolderPath = FolderPath?replace("%20", " ") />
51 <#assign isDocRoot = "false" />
52 <#assign imageGroupId = -1 />
53 <#assign imageFolderId = -1 />
54
55 <#assign folderPaths = FolderPath?split("/") />
56 <#list folderPaths as xPath>
57
58 <#if xPath != "/" && xPath != "">
59 <#if isDocRoot == "false">
60 <#if xPath == "documents">
61 <#assign isDocRoot = "true" />
62 </#if>
63 <#else>
64 <#if imageGroupId == -1>
65 <#assign tempXpath = "/" + xPath />
66 <#assign targetGroup = GroupLocalServiceUtil.fetchFriendlyURLGroup(themeDisplay.getCompanyId(), tempXpath) />
67 <#if targetGroup?? >
68 <#assign imageGroupId = targetGroup.getGroupId() />
69 <#assign imageFolderId = 0 />
70 </#if>
71 <#else>
72 <#assign imageFolderId = DLFolderLocalServiceUtil.getFolder(imageGroupId , imageFolderId, xPath).getFolderId() />
73 </#if>
74
75 </#if>
76 </#if>
77 </#list>
78
79 <#if (imageGroupId != -1 && imageFolderId != -1)>
80 <#assign fileEntriesFolder = DLFileEntryLocalServiceUtil.getFileEntries(imageGroupId,imageFolderId) />
81 <#if fileEntriesFolder?? && (fileEntriesFolder?size > 0 ) >
82 <#assign fileEntry = fileEntriesFolder[1] />
83 <#if fileEntry??>
84 <#assign fileUrl = "/documents/" + fileEntry.getGroupId() + "/" + fileEntry.getFolderId() + "/" + fileEntry.getTitle() + "/" + fileEntry.getUuid() />
85 </#if>
86 </#if>
87 </#if>
88
89 <#else>
90 <#assign fileUrl = imagePath + "/toscana-notizie-placeholder.png" />
91 </#if>
92 <div class="rt-box rt-box--has-image rt-box--gallery">
93 <a href="${rendererURL?html}" aria-label="Immagine di ${titleText?html}" class="rt-box__image" style="background-image: url('${fileUrl?html}');">
94 </a>
95
96 <div class="rt-box__text">
97 <div class="rt-box__title">
98 <a title="Vai alla pagina ${titleText?html}" aria-label="Vai alla pagina ${titleText?html}" href="${rendererURL?html}">
99 ${titleText?html}
100 </a>
101 </div>
102 </div>
103 </div>
104 </#if>
105 </#if>
106 </#list>
107 </#if>
108 </div>
109 </section>
110 </div>
111</div>