News
Fehler bei der Verarbeitung der Vorlage.
Failed to "?eval" string with this error: ---begin-message--- Syntax error in ?eval-ed string in line 3, column 17: Encountered ")", but was expecting one of: <STRING_LITERAL> <RAW_STRING> "false" "true" <INTEGER> <DECIMAL> "." "+" "-" "!" "[" "(" "{" <ID> ---end-message--- The failing expression: ==> artImg.selectSingleNode(titoloNode).getStringValue()?eval [in template "20097#20123#278261" at line 100, column 19] ---- FTL stack trace ("~" means nesting-related): - Failed at: artImgHash = artImg.selectSingleNode(... [in template "20097#20123#278261" at line 100, column 6] ----
1<#-- =================== PARTI GENERICHE ======================== -->
2
3<#--
4<textarea style="height: 800px; width: 500px;">
5${docTotale}
6
7</textarea>
8-->
9
10<#-- =================== PER RECUPERARE IL JSON DELLA STRUTTURA ===================
11<#assign structureKey = DDMStructureLocalService.getStructure(112939) />
12 <h1>${structureKey}</h1> -->
13
14
15<#-- =================== FINE PARTI GENERICHE =================== -->
16
17
18<#-- =================== INIZIO PARTE NEWS LOOP =================== -->
19
20<main>
21<section class="section">
22<div class="container" id="newsContainer">
23 <h3 class="title pt-5 pb-2">Ultime Notizie e comunicati</h3>
24
25<#if entries?has_content>
26
27 <#assign idxLoop = 0 />
28
29 <#list entries as curEntry> <#-- INIZIO LOOP (indici 0-based)-->
30
31
32<#assign idxLoop = curEntry?index />
33
34<#if idxLoop % 4 == 0 >
35
36<#if idxLoop != 0> <#-- se non è il primo gruppo di 4 elementi chiudo il precedente -->
37</div>
38</#if>
39
40<#-- inizio il nuovo gruppo -->
41 <div class="secondari row row-flex" >
42</#if>
43
44
45<#-- A GRUPPI DI 4 ELEMENTI DELLA LISTA DEVO GENERARE LA STRUTTURA <div class="row mb-5 element"> -->
46
47<#assign newsTitle = curEntry.getTitle(locale) />
48<#assign newsSummary = curEntry.getSummary(locale) />
49<#assign dataPub = curEntry.getPublishDate() />
50
51
52
53<#assign renderer = curEntry.getAssetRenderer() />
54<#assign Article = renderer.getArticle() />
55<#assign smallImageID = Article.getSmallImageId() />
56<#if smallImageID??>
57<#assign smallImageURL = "/image/image_gallery?img_id=${smallImageID}" />
58<#else>
59<#assign smallImageURL = Article.getSmallImageURL() />
60</#if>
61
62<#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry) />
63<#assign viewURLAsset = renderer.getURLViewInContext(renderRequest, renderResponse, viewURL) />
64
65
66
67<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
68<#assign DDMStructureLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMStructureLocalService") >
69<#assign article = journalArticleLocalService.getLatestArticle(Article.resourcePrimKey) />
70<#assign docTotale = article.getContentByLocale(localeUtil.toLanguageId(localeUtil.getDefault())) />
71<#assign doc = saxReaderUtil.read(article.getContentByLocale(localeUtil.toLanguageId(localeUtil.getDefault()))) />
72
73<#-- INIZIO LETTURA CAMPI -->
74<#assign rootElement = doc.getRootElement() />
75<#assign news = rootElement.selectNodes("/Ttiolo") />
76 <#assign document = saxReaderUtil.read(article.getContentByLocale(locale))>
77
78<#assign dlAppLocalServiceUtil = staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"] >
79<#assign dlUtil = staticUtil["com.liferay.document.library.kernel.util.DLUtil"] >
80
81
82<#assign titoloNodePath = saxReaderUtil.createXPath("dynamic-element[@name='Ttiolo']") />
83<#assign titoloNode = titoloNodePath.selectSingleNode(rootElement) />
84
85<#assign xPathSelector = saxReaderUtil.createXPath("dynamic-content") />
86<#assign titoloVal = xPathSelector.selectSingleNode(titoloNode).getStringValue() />
87
88<#assign xPathData = saxReaderUtil.createXPath("dynamic-element[@name='DataNotizia']/dynamic-content") />
89<#assign dataNotizia = xPathData.selectSingleNode(titoloNode).getStringValue() />
90
91<#assign xPathAbstract = saxReaderUtil.createXPath("dynamic-element[@name='Abstract']/dynamic-content") />
92<#assign abstract = xPathAbstract.selectSingleNode(titoloNode).getStringValue() />
93
94
95
96<#assign
97 journal = entry.getAssetRenderer().getArticle()
98 rootElement2 = saxReaderUtil.read(journal.content).getRootElement()
99 artImg = saxReaderUtil.createXPath("dynamic-element[@name='Foto']")
100 artImgHash = artImg.selectSingleNode(titoloNode).getStringValue()?eval
101
102
103
104
105/>
106<#assign uuid = "" />
107<#assign groupId = 0 />
108
109<#list artImgHash as k,v>
110 <#if k == "uuid">
111 <#assign uuid = artImgHash[k] />
112
113 </#if>
114
115 <#if k == "groupId">
116 <#assign groupId = artImgHash[k] />
117
118 </#if>
119
120</#list>
121
122
123
124
125<#assign artImgURL="#" />
126
127 <#assign
128 dlFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppLocalService")
129 dlURLHelper = serviceLocator.findService("com.liferay.document.library.util.DLURLHelper")
130
131
132
133
134 artImgDLFile = dlFileEntryLocalService.getFileEntryByUuidAndGroupId(uuid, groupId?number)
135 artImgURL = dlURLHelper.getImagePreviewURL(artImgDLFile, themeDisplay)
136
137/>
138
139
140
141<#assign viewURLAsset="${viewURLAsset?replace('7mvLuNvJgJDm','SnWbrCofr6d3')? replace('hgntWMpGAOS6','SnWbrCofr6d3')?replace('vZy8hDS4wZW0','SnWbrCofr6d3')?replace('5bI3KCtMcfO9','SnWbrCofr6d3')}"
142>
143
144<#assign viewURLAsset="${viewURLAsset?replace('avvisi-pubblici','dettaglio-news')? replace('home','dettaglio-news')? replace('tutte-news','dettaglio-news')?replace('notizie','dettaglio-news')}"
145>
146
147<#-- ========== COSTRUZIONE HTML SINGOLA NEWS ==================== -->
148
149
150
151 <div class="col-lg-3 col-md-4 col-sm-6 mb-4 ">
152 <div class="com-item content bg-grigio">
153 <div class="img-box ">
154 <a href="${viewURLAsset}">
155 <img src="${artImgURL}" alt="${titoloVal}" class="img-fluid-news" />
156 </a>
157 </div>
158 <div class="testo " style="padding:1rem;">
159 <a style="display: block; text-decoration: none;" href="${viewURLAsset}">
160 <h4 class="titolo" >${titoloVal}</h4>
161 </a>
162 <#if dataNotizia?? && dataNotizia?has_content>
163 <p class="foo"><span class="tipo">Notizie</span>
164 <#assign someDate = dataNotizia?date.xs>
165 <span class="data">${someDate?string["dd/MM/yyyy"]}</span></p>
166 </#if>
167 </div>
168
169 </div>
170 </div>
171
172
173
174
175
176<#-- =================== FINE COSTRUZIONE SINGOLA News ======================= -->
177
178
179<#-- FINE -->
180
181
182
183
184
185
186
187 </#list> <#-- FINE LOOP -->
188
189<#-- se l'ultimo indice generato è mod 4 allora vuol dire che il penultimo,quello del ciclo non è multiplo di quattro
190per cui va chiuso l'ultimo div aperto -->
191<#if idxLoop %4 == 0>
192</div>
193</#if>
194
195
196
197
198</#if>
199<#-- FINE NEWS LOOP -->
200
201
202 </div> <#-- chiusura div.container -->
203</section>
204
205</main>
206
207
208<#assign img_folder = themeDisplay.getPathThemeImages() + '/../img' />
209<script src="${img_folder}/../js/jquery.easyPaginate.js" ></script>
210
211<script type="text/javascript">
212
213jQuery(document).ready(function($) {
214 jQuery('#newsContainer').easyPaginate({
215 paginateElement: 'div.element',
216 elementsPerPage: 3,
217 effect: 'climb',
218
219 });
220
221 // per centrare la paginazione
222 jQuery('.easyPaginateNav').css('margin','0 auto').css('text-align','center');
223 // colore e padding numero di pagina
224 jQuery('.easyPaginateNav .page').css('color','var(--black)').css('padding','.1rem');
225
226 });
227
228
229
230
231
232
233</script>
234
235
236<script type="text/javascript">
237
238jQuery(document).ready(function($) {
239 jQuery('#newsContainer').easyPaginate({
240 paginateElement: 'div.element',
241 elementsPerPage: 3,
242 effect: 'climb',
243
244 });
245
246 // per centrare la paginazione
247 jQuery('.easyPaginateNav').css('margin','0 auto').css('text-align','center');
248 // colore e padding numero di pagina
249 jQuery('.easyPaginateNav .page').css('color','var(--black)').css('padding','.1rem');
250
251 });
252
253
254
255
256
257
258</script>
259<script type="text/javascript">
260
261AUI().ready(function () {
262
263var t = jQuery.noConflict();
264 try{
265 t.DataTable();
266
267
268}catch(e){
269
270
271}
272 jQuery('#newsContainer').easyPaginate({
273 paginateElement: 'div.element',
274 elementsPerPage: 3,
275 effect: 'climb',
276
277 });
278
279 // per centrare la paginazione
280 jQuery('.easyPaginateNav').css('margin','0 auto').css('text-align','center');
281 // colore e padding numero di pagina
282 jQuery('.easyPaginateNav .page').css('color','var(--black)').css('padding','.1rem');
283
284 });
285</script>
286<style>
287
288.img-box {
289 height: 170px !important;
290 object-fit: cover;
291}
292.img-fluid-news{
293 height: 170px;
294 width: 100%;
295 object-fit: cover;
296
297}
298</style>
—
12 Elemente pro Seite