Suggeriti per te

La Marmilla è ricca di luoghi da scoprire. In base al tuo profilo, ecco alcuni suggerimenti per iniziare la tua esperienza in Marmilla. Seleziona il tuo profilo preferito e avrai dei suggerimenti personalizzati.

Si è verificato un errore nell'elaborarazione del modello.
Failed to "?eval" string with this error:

---begin-message---
Syntax error in ?eval-ed string in line 10, column 122:
Lexical error: encountered "u" (117), after "\"Chiesa dell\\".
---end-message---

The failing expression:
==> ret?eval  [in template "187954#187982#448189" at line 226, column 26]

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign ret = ret?eval  [in template "187954#187982#448189" in function "searchRec" at line 226, column 13]
----
1<#-- 
2template utilizzo libreria di ricerca e visualizzazione fascia 
3Utilizza configuratore asset publisher: 
4		 struttura 
5		 categorie 
6		 numero di elementi 
7--> 
8	<#import "_TEMPLATE_CONTEXT_/187954/209100/23609/234927" as d40> 
9	<#import "_TEMPLATE_CONTEXT_/187954/209100/23609/244270" as sr> 
10 
11<#assign 
12    portletPreferences = freeMarkerPortletPreferences.getPreferences("portletSetupPortletDecoratorId", "barebone") 
13    prefs = renderRequest.getPreferences() 
14    classTypeIds = prefs.getValue("classTypeIds", "") 
15    structureKey = 0 
16    contentType = "placeholder" 
17    numItems = prefs.getValue("delta", "3") 
18    cats = prefs.getValues("queryValues0", []) 
19    langId = locale?keep_before("_") 
20    unifiedCategories = [] 
21		mynm=renderResponse.getNamespace() 
22		JSFactoryUtil = staticUtil["com.liferay.portal.kernel.json.JSONFactoryUtil"] 
23    d40Srv = serviceLocator.findService("eu.suggesto.d40.builder.d40.service.TourismItemLocalService") 
24    sRec = serviceLocator.findService("eu.suggesto.servicecs.service.SuggestoRecommenderLocalService") 
25     serviceName = "0:esmarmilla" 
26		 profili = themeDisplay.getURLCurrent()?keep_after("?profili=") 
27		structureKeyEventi=207094 
28				  
29 
30/> 
31	 
32	 
33 
34		<#-- PROFILI https://discovermarmilla.d40.it/test-dettaglio?profili=outdoor,storia,tradizione,arte --> 
35 
36<#-- recupero la lista di categorie eventualmente impostate dal contenuto di dettaglio (articleDetails) --> 
37<#assign unifiedCategories=d40.getCircularCategories("Comuni")> 
38<#list cats as cat> 
39    <#assign unifiedCategories += [cat?string]> 
40</#list> 
41	<#if profili?contains("natura")> 
42			<#list ["339591"] as cat> 
43         <#assign unifiedCategories += [cat?string]> 
44      </#list> 
45		</#if> 
46		<#if profili?contains("storia")> 
47			<#list ["339454","343956"] as cat> 
48         <#assign unifiedCategories += [cat?string]> 
49      </#list> 
50		</#if> 
51		<#if profili?contains("tradizione")> 
52			<#list ["339636","358454"] as cat> 
53         <#assign unifiedCategories += [cat?string]> 
54      </#list> 
55		</#if> 
56		<#if profili?contains("arte")> 
57			<#list ["208223"] as cat> 
58         <#assign unifiedCategories += [cat?string]> 
59      </#list> 
60 
61			</#if>	 
62 
63   
64	<#if classTypeIds?has_content> 
65    <#assign structureKey = classTypeIds?number-1!> 
66</#if>	 
67 
68<#-- 
69		 funzione searchRec 
70		 primo parametro StructureKey 
71		 secondo parametro numero di item 
72		 terzo parametro cats (should) 
73--> 
74 
75		<#assign result=searchRec(structureKey,numItems?number,unifiedCategories)> 
76 
77<!-- ESPERIENZE RELAZIONATE --> 
78			<#assign ddmTemplateKey="280171"> 
79<#if structureKey==structureKeyEventi> 
80			<#assign ddmTemplateKey="453781"> 
81	</#if> 
82<#if result?has_content && unifiedCategories?size gt 0> 
83	<div class="esperienzeContent"> 
84		<div class="rowRelated mt-5 pt-lg-5"> 
85				<div class="container-fluid"> 
86					<#-- Embed web content --> 
87					<div class="py-10 portlet-inject"> 
88						<@liferay_portlet["runtime"] 
89								defaultPreferences="${portletPreferences}" 
90								portletProviderAction=portletProviderAction.VIEW 
91								portletName="com_liferay_journal_content_web_portlet_JournalContentPortlet" 
92								instanceId="inject-portlet-${mynm}" 
93						/> 
94					</div> 
95 
96					<div class="slider position-relative mt-lg-2 mt-4"> 
97						<div class="swiper carousel sliderRelated_${mynm}"> 
98							<div class="swiper-wrapper"> 
99								<#list result as x> 
100									 
101								 
102									 
103									<div class="swiper-slide"> 
104										<@liferay_journal["journal-article"] 
105											articleId=x.articleId 
106											ddmTemplateKey=ddmTemplateKey 
107											groupId=x.groupId 
108										/> 
109									</div> 
110								</#list> 
111							</div> 
112						</div> 
113						 
114						<div class="swiperBtn swiper-button-next"><img src="/o/marmilla-theme/images/suggesto/upBlack.svg"></div> 
115            <div class="swiperBtn swiper-button-prev"><img src="/o/marmilla-theme/images/suggesto/upBlack.svg"></div> 
116 
117						<div class="swiper-pagination"></div> 
118 
119						<script type="text/javascript"> 
120							document.addEventListener('DOMContentLoaded', (e) => { 
121								SuggestoImages.slider(".sliderRelated_${mynm}", { 
122									breakpoints: { 
123										991: { slidesPerView: 3, spaceBetween: 15 }, 
124										769: { slidesPerView: 2, spaceBetween: 10 }, 
125										0: { slidesPerView: 1, spaceBetween: 0 } 
126
127								}); 
128							}); 
129						</script> 
130					</div> 
131				</div> 
132		</div> 
133	</div> 
134</#if> 
135	 
136 
137	<#function searchRec ddmStructureKey  numItems=10 cats=[]> 
138		<#assign rnd="rnd"> 
139    <#assign skipItems = 0 > 
140    <#assign sortOrder = "" > 
141    <#assign queryEs=JSFactoryUtil.createJSONObject()> 
142    <#assign query=JSFactoryUtil.createJSONObject()> 
143    <#assign jbool=JSFactoryUtil.createJSONObject()> 
144    <#assign must=JSFactoryUtil.createJSONArray()> 
145    <#assign should=JSFactoryUtil.createJSONArray()> 
146    <#assign _source=JSFactoryUtil.createJSONArray()> 
147    <#assign query_string=JSFactoryUtil.createJSONObject()> 
148    <#assign queryBody=JSFactoryUtil.createJSONObject()> 
149    <#assign szExpDate=.now?string('yyyy')+.now?string('MM')+.now?string('dd')+.now?string('hh') +.now?string('mm') +.now?string('ss') > 
150			 
151<#-- se eventi, aggiungere  la ricerca per data fine maggore di oggi { 
152                "ddmFieldName": "ddm__keyword__207095__dateEnd", 
153                "ddmFieldValueKeyword": "2024-07-17", 
154                "ddmValueFieldName": "ddmFieldValueKeyword", 
155                "ddmFieldValueKeyword_String_sortable": "2024-07-17" 
156
157	--> 
158		  
159    <#assign z=query_string.put("query", "ddmStructureKey:${ddmStructureKey} AND head:true AND status:0 AND expirationDate:[${szExpDate} TO *] AND NOT groupId:206314")> 
160    <#assign z=queryBody.put("query_string", query_string)> 
161    <#assign z=must.put(queryBody)> 
162			 
163<#if ddmStructureKey==structureKeyEventi> 
164    <#assign szTodayDateEvent=.now?string('yyyy')+"-"+.now?string('MM')+"-"+.now?string('dd') > 
165    <#assign nestedObjSz="{\"nested\":{\"path\":\"ddmFieldArray\",\"query\":{\"bool\":{\"must\":[{\"match\":{\"ddmFieldArray.ddmFieldName\":\"ddm__keyword__207095__dateEnd\"}},{\"range\":{\"ddmFieldArray.ddmFieldValueKeyword\":{\"gte\":\"${szTodayDateEvent}\"}}}]}}}}"> 
166    <#assign nestedObj=JSFactoryUtil.createJSONObject(nestedObjSz)> 
167    <#assign z=must.put(nestedObj)> 
168</#if> 
169			 
170			 
171    <#list cats as cat> 
172        <#assign px_query_string=JSFactoryUtil.createJSONObject()> 
173        <#assign queryBodyPx=JSFactoryUtil.createJSONObject()> 
174        <#assign z=px_query_string.put("query", "assetCategoryIds:${cat}")> 
175        <#assign z=queryBodyPx.put("query_string", px_query_string)> 
176        <#assign z=should.put(queryBodyPx)> 
177		</#list> 
178    <#assign z=_source.put("articleId")> 
179    <#assign z=_source.put("groupId")> 
180    <#assign z=_source.put("title_it_IT")> 
181    <#assign z=_source.put("assetCategoryIds")> 
182    <#assign z=jbool.put("should",should)> 
183    <#assign z=jbool.put("must",must)> 
184    <#assign z=query.put("bool",jbool)> 
185<#-- RND SEARCH --> 
186	<#if rnd=="rnd"> 
187    <#assign function_score=JSFactoryUtil.createJSONObject()> 
188    <#assign random_score=JSFactoryUtil.createJSONObject()> 
189    <#assign qr2=JSFactoryUtil.createJSONObject()> 
190<#--    <#assign z=random_score.put("seed",2)> --> 
191    <#assign z=function_score.put("random_score",random_score)> 
192    <#assign z=function_score.put("boost_mode","multiply")>  
193    <#assign z=function_score.put("query",query)> 
194    <#assign z=qr2.put("function_score",function_score)> 
195			<#assign z=queryEs.put("query",qr2)> 
196	<#else> 
197    <#assign z=queryEs.put("query",query)> 
198</#if> 
199<#-- fine random --> 
200    <#assign z=queryEs.put("_source",_source)> 
201 
202    <#assign result = sRec.search("0", serviceName,"",queryEs,sortOrder,skipItems,numItems)> 
203		 
204    <#if  ! result?has_content> 
205        <#assign ret> 
206            [] 
207        </#assign> 
208    <#else> 
209        <#assign numFound =result.getJSONObject("data").getJSONObject("response").getString("numFound")?number> 
210        <#assign start =result.getJSONObject("data").getJSONObject("response").getString("start")?number> 
211        <#if numFound gt 0 && start lt numFound> 
212            <#assign start =result.getJSONObject("data").getJSONObject("response").getString("start")> 
213            <#assign items =result.getJSONObject("data").getJSONObject("response").getJSONArray("docs")> 
214            <#list 0..items.length()-1 as i> 
215                <#assign szGroupId=items.getJSONObject(i).getString("groupId")> 
216                <#assign x=items.getJSONObject(i).put("groupId",szGroupId?number)> 
217            </#list> 
218            <#assign ret> 
219
220            <#list 0..items.length()-1 as i> 
221                ${items.getJSONObject(i)} 
222            <#if i !=items.length()-1>,</#if> 
223            </#list> 
224
225            </#assign> 
226            <#assign ret=ret?eval> 
227        <#else>   
228            <#assign ret = [] > 
229        </#if>  			 
230    </#if>  			 
231    <#return ret> 
232</#function>