Lokalizacja
Wystąpił błąd podczas przetwarzania szablonu.
The following has evaluated to null or missing: ==> geoLoc_customgeolocation [in template "20116#20152#LOCATION-ELEMENT-DETAIL" at line 152, column 6] ---- Tip: If the failing expression is known to be 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: #if geoLoc_customgeolocation.getData(... [in template "20116#20152#LOCATION-ELEMENT-DETAIL" at line 152, column 1] ----
1<style>
2 #map-detail {
3 height: 540px;
4 margin-top: 1em;
5 }
6
7 #map-detail .lfr-map {
8 height: 100%;
9 }
10
11 .b-map-detail__address{
12 font-size: 24px;
13 line-height: 1.5;
14 letter-spacing: 0.5px;
15 padding: 20px 0;
16 }
17
18 .b-map-detail__title{
19 font-size: 40px;
20 padding: 20px 0;
21 }
22
23 .b-map-detail__info{
24 padding: 20px 0;
25 font-size: 16px;
26 line-height: 1.5;
27 }
28
29 .b-map-detail__social{
30 padding: 20px 0;
31 }
32
33 .b-map-detail__social a{
34 padding: 5px;
35 border: 1px solid black;
36 border-radius: 5px;
37 color: black;
38 }
39
40 .b-map-detail__social a:nth-child(even) {
41 margin: 0 20px;
42 }
43
44
45 .b-map-detail__list-services{
46 color: #34a6f8;
47 }
48
49 .b-map-detail__info .b-map-detail__summary p,
50 .b-map-detail__info .b-map-detail__products p {
51 font-size: 16px;
52 line-height: 1.5;
53 font-weight: normal;
54 }
55
56 .glyphicon {
57 top: 2px;
58 }
59
60 .img-responsive {
61 padding-left:10px;
62 }
63
64 * {box-sizing: border-box;}
65 .ro::after {content: ""; clear: both; display:block;}
66 [class*="co-"] {float: left; padding:15px; margin-bottom:10px; margin-left:1px; margin-right:1px; border:thin solid #eeeeee; min-height:150px;}
67 .co-1 {width:24%; min-height:330px;}
68 .co-2 {width:24%; min-height:330px;}
69 .co-3 {width:24%; min-height:330px;}
70 .co-4 {width:24%; min-height:330px;}
71 .prodLink {color:#000000; font-weight:bold;} .prodLink a:hover {color:#000000;}
72 .prodLink a {color:#000000;}
73 @media only screen and (max-width: 1450px) { [class*="co-"] {width: 100%;}}
74 .pd1 {max-width:70%; margin-left:auto; margin-right:auto; margin-top:20px; padding:10px;}
75</style>
76
77
78
79<#-- testovaci vypis -->
80<#-- <p>
81 <#if locationName?? && locationName.getData() != "">
82 locationName: ${locationName.getData()}<br>
83 </#if>
84
85 <#if summary?? && summary.getData() != "">
86 summary: ${summary.getData()}<br>
87 </#if>
88
89 <#if image?? && image.getData() != "">
90 Obrazek: <#if image.getData()?? && image.getData() != "">
91 <img alt="${image.getAttribute("alt")}" data-fileentryid="${image.getAttribute("fileEntryId")}" src="${image.getData()}" />
92 </#if><br>
93 </#if>
94
95 <#if locationAddress.street?? && locationAddress.street.getData() != "">
96 locationAddress.street: ${locationAddress.street.getData()}<br>
97 </#if>
98
99 <#if locationAddress.city?? && locationAddress.city.getData() != "">
100 locationAddress.city: ${locationAddress.city.getData()}<br>
101 </#if>
102
103 <#if locationAddress.postcode?? && locationAddress.postcode.getData() != "">
104 locationAddress.postcode: ${locationAddress.postcode.getData()}<br>
105 </#if>
106
107 <#if locationAddress.area?? && locationAddress.area.getData() != "">
108 locationAddress.area: ${locationAddress.area.getData()}<br>
109 </#if>
110
111 <#if locationAddress.country?? && locationAddress.country.getData() != "">
112 locationAddress.country: ${locationAddress.country.getData()}<br>
113 </#if>
114
115 <#if servicesList?? && servicesList.getData() != "">
116 servicesList: ${servicesList.getData()}<br>
117 </#if>
118
119 <#if SalesDepartment?? && SalesDepartment.getData() != "">
120 SalesDepartment: ${SalesDepartment.getData()}<br>
121 </#if>
122
123 <#if SalesRepresentative?? && SalesRepresentative.getData() != "">
124 SalesRepresentative: ${SalesRepresentative.getData()}<br>
125 </#if>
126
127 <#if linkToPage?? && linkToPage.getData() != "">
128 <a href="${linkToPage.getFriendlyUrl()}">
129 Link to Page
130 </a><br>
131 </#if>
132
133 <#if openingHours?? && openingHours.getData() != "">
134 openingHours: ${openingHours.getData()}<br>
135 </#if>
136
137 <#if orders.email?? && orders.email.getData() != "">
138 orders.email: ${orders.email.getData()}<br>
139 </#if>
140
141 <#if orders.phoneNumber?? && orders.phoneNumber.getData() != "">
142 orders.phoneNumber: ${orders.phoneNumber.getData()}<br>
143 </#if>
144</p> -->
145
146<#assign categoryProductList = "Product">
147<#-- assign categoryLocationType = "Location type"-->
148
149<#assign geoLocLatitude = 0>
150<#assign geoLocLongitude = 0>
151
152<#if geoLoc_customgeolocation.getData() != "">
153 <#assign geolocationJSONObject = jsonFactoryUtil.createJSONObject(geoLoc_customgeolocation.getData())>
154 <#assign geoLocLatitude = geolocationJSONObject.getDouble("latitude")>
155 <#assign geoLocLongitude = geolocationJSONObject.getDouble("longitude")>
156</#if>
157
158<#assign journalArticleId = .vars['reserved-article-id'].data>
159<#assign journalArticleResourceLocalServiceUtil = serviceLocator.findService('com.liferay.journal.service.JournalArticleResourceLocalService')>
160<#assign assetCategoryLocalServiceUtil = serviceLocator.findService('com.liferay.asset.kernel.service.AssetCategoryService')>
161
162<#assign articleResourcePK = journalArticleResourceLocalServiceUtil.getArticleResourcePrimKey(groupId, journalArticleId)/>
163<#assign categoryList=assetCategoryLocalServiceUtil.getCategories("com.liferay.journal.model.JournalArticle",articleResourcePK) >
164
165<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext() />
166<#assign themeDisplay = serviceContext.getThemeDisplay() />
167
168<#assign alternateImageLogo = "/documents/46481509/46484417/cemex-logo.svg/f2a4448b-ce05-5ca4-a4cb-7b6a5e81e574" />
169<#assign googleApiKey = "AIzaSyDVyErlQi9U0jRmlwXA0G60dy8IMrDvVK0" />
170
171
172<#-- start HTML -->
173
174<script type="application/ld+json">
175 {
176 "@context": "http://schema.org",
177 "@type": "LocalBusiness",
178 "address": {
179 "@type": "PostalAddress",
180 "streetAddress": "${locationAddress.street.getData()}",
181 "addressLocality": "${locationAddress.city.getData()}",
182 "addressRegion": "${locationAddress.area.getData()}",
183 "postalCode": "${locationAddress.postcode.getData()}"
184 },
185 "name": "${locationName.getData()}",
186 "image": <#if image?? && image.getData() != "">"${themeDisplay.getPortalURL()}${image.getData()}"<#else>"${themeDisplay.getPortalURL()}${alternateImageLogo}"</#if>,
187 "description": <#if summary?? && summary.getData() != "">${summary.getData()}</#if>,
188 "telephone": <#if orders.phoneNumber?? && orders.phoneNumber.getData() != "">${orders.phoneNumber.getData()}</#if>,
189 "faxNumber": "",
190 "openingHours": "${openingHours.getData()}",
191 "url": "${themeDisplay.getPortalURL() + themeDisplay.getURLCurrent()}",
192 "geo": {
193 "@type": "GeoCoordinates",
194 "latitude": "${geoLocLatitude}",
195 "longitude": "${geoLocLongitude}"
196 },
197
198 "hasmap": "https://maps.google.com/maps?saddr=berlin&daddr=${geoLocLatitude},${geoLocLongitude}"
199 }
200</script>
201
202<div class="container">
203
204 <div class="row">
205 <div class="col-md-12">
206
207 <h1 class="b-map-detail__title">${locationName.getData()}</h1>
208
209 <div class="b-map-detail__rating">
210 <#if GooglePlaceID?? && GooglePlaceID.getData() != "">
211 ${printRating(GooglePlaceID.getData(), googleApiKey)}
212 </#if>
213 </div>
214
215 </div>
216
217 <div class="col-xs-12">
218
219 <div class="b-map-detail__address">
220 <span>
221 <h2>${locationAddress.street.getData()}, ${locationAddress.postcode.getData()} ${locationAddress.city.getData()}, ${locationAddress.area.getData()}</h2>
222 </span>
223 </div>
224
225 </div>
226
227 </div>
228
229 <div class="row b-map-detail__info">
230
231 <div class="col-md-6">
232
233 <div class="b-map-detail__products">
234
235 <p>
236 <span>
237 Produkty dostępne z tej lokalizacji:
238 </span>
239 </p>
240
241 <p>
242 <span>
243 <strong class="b-map-detail__list-services"><@printLocationProducts/></strong>
244 </span>
245 </p>
246
247 </div>
248
249 <div class="b-map-detail__summary">
250 <p class="b-map-detail__summary">
251 <span>
252 ${summary.getData()}
253 </span>
254 </p>
255 </div>
256
257 <div class="b-map-detail__phones">
258 <p class="b-map-detail__phones">
259 <div class="b-map-detail__phone">
260 <span>
261 <#if orders.phoneNumber?? && orders.phoneNumber.getData() != "">
262 Telefon: <a href="tel:${orders.phoneNumber.getData()}">${orders.phoneNumber.getData()}</a>
263 </#if>
264 </span>
265 </div>
266 <div class="b-map-detail__phone">
267 <span>
268 <#if orders.email?? && orders.email.getData() != "">
269 E-mail: <a href="mailto:${orders.email.getData()}">${orders.email.getData()}</a>
270 </#if>
271 </span>
272 </div>
273 <br>
274 <div class="b-map-detail__phone">
275 <span>
276 <#if SalesDepartment?? && SalesDepartment.getData() != "">
277 Sprzedaż: <a href="tel:${SalesDepartment.getData()}">${SalesDepartment.getData()}</a>
278 </#if>
279 </span>
280 </div>
281
282 <div class="b-map-detail__phone">
283 <span>
284 <#if SalesRepresentative?? && SalesRepresentative.getData() != "">
285 Sprzedaż: <a href="tel:${SalesRepresentative.getData()}">${SalesRepresentative.getData()}</a>
286 </#if>
287 </span>
288 </div>
289 </p>
290 <#if openingHours?? && openingHours.getData() != "">
291 <#--Opening Hours: -->${openingHours.getData()}
292 </#if>
293 </div>
294
295 </div>
296
297 <div class="col-md-6">
298 <#if image.getData()?? && image.getData() != "">
299 <img class="img-responsive" data-fileentryid="${image.getAttribute("fileEntryId")}" alt="${image.getAttribute("alt")}" src="${image.getData()}" />
300 </#if>
301 </div>
302</div>
303
304<div class="row">
305 <div class="col-md-12">
306
307 <div id="map-detail">
308 <#if (geoLoc_customgeolocation.getData() != "")>
309 <@liferay_map["map-display"]
310 geolocation=true
311 latitude=geoLocLatitude
312 longitude=geoLocLongitude
313 name="geoLoc_customgeolocation"
314 />
315 </#if>
316 </div>
317
318 </div>
319</div>
320
321
322<#-- ################################## -->
323
324<#-- show Google Ratings -->
325<#function printRating glid gapi>
326 <#assign response = httpUtil.URLtoString("https://maps.googleapis.com/maps/api/place/details/json?placeid="+glid+"&fields=name,rating,user_ratings_total,url&key="+gapi) >
327 <#assign resp = response?eval>
328 <#assign return = "">
329 <#if resp.result??>
330 <#if !resp.result.rating??>
331 <#assign rate = 0>
332 <#assign user_rates = 0>
333 <#else>
334 <#assign rate = resp.result.rating>
335 <#assign user_rates = resp.result.user_ratings_total>
336 </#if>
337 <#assign return = return + rate + " " + countStars(rate)>
338 <#assign return = return + ' | <a href="' + resp.result.url + '" target="_blank">' + user_rates + ' Bewertungen</a>'>
339 <#-- control print of the place name, api key and place id
340 <#assign return = return + "Name: " + resp.result.name >
341 <#assign return = return + "<BR>GLID: "+glid+"<BR> GAPI: "+gapi+"BR">
342 -->
343 <#else>
344 <#assign return = return + resp.status + "<br>">
345 <#if resp.error_message??>
346 <#assign return = return + resp.error_message>
347 </#if>
348 </#if>
349 <#return return>
350</#function>
351
352<#-- wwrite stars based on number -->
353<#function countStars stars>
354 <#assign return = "">
355 <#list 1..5 as x>
356 <#if (x > stars)>
357 <#assign return = return + '<i class="glyphicon glyphicon-star-empty"></i>'>
358 <#else>
359 <#assign return = return + '<i class="glyphicon glyphicon-star"></i>'>
360 </#if>
361 </#list>
362 <#return return>
363</#function>
364
365<#-- print list of location products -->
366<#macro printLocationProducts>
367 <#list categoryList as categoryList>
368 <#if categoryList.getParentCategory().name = categoryProductList>
369 ${categoryList.getName()}<#sep>, </#sep>
370 </#if>
371 </#list>
372
373</#macro>
Dowiedz się więcej
Skontaktuj się z nami, aby uzyskać więcej informacji o naszych produktach i usługach.