IBC 2019

null IBC 2019

An error occurred while processing the template.
The following has evaluated to null or missing:
==> cmsEntity.getLocalizedField(profile, "/entity/assets/mainImage")  [in template "20116#20152#379608" at line 57, column 24]

----
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: #assign mainImg = cmsEntity.getLocali...  [in template "20116#20152#379608" at line 57, column 5]
----
1<#-- Include common helpers --> 
2<#include "${templatesPath}/379393" /> 
3 
4<#assign t = { 
5    "locationTitle" : "Location" 
6}> 
7 
8<#-- Get and format article publish date --> 
9<#assign displayDate = .vars['reserved-article-display-date'].data> 
10 
11<#-- Save the original page locale for later --> 
12<#assign originalLocale = locale> 
13 
14<#-- Set the page locale to the portals default locale --> 
15<#setting locale = localeUtil.getDefault()> 
16 
17<#-- Parse the date to a date object --> 
18<#assign displayDate = displayDate?datetime("EEE, d MMM yyyy HH:mm:ss Z")> 
19 
20<#assign cmsContentService= serviceLocator.findService("com.ch5finland.genelec.cms.service.CMSContentService") > 
21<#assign profileService = serviceLocator.findService("com.ch5finland.genelec.cms.service.ProfileService") > 
22 
23 
24<#assign 
25	defaultLatitude = -3.6833 
26	defaultLongitude = 40.40 
27	 
28	group = themeDisplay.getScopeGroup() 
29 
30	googleMapsAPIKey = group.getLiveParentTypeSettingsProperty("googleMapsAPIKey")!""	 
31
32 
33<#assign profile = profileService.getProfile(request) > 
34<#assign journalArticleId = .vars['reserved-article-id'].data> 
35<#assign cmsEntity = cmsContentService.getEntityByArticleId(profile, groupId, journalArticleId) > 
36 
37<#assign cmsContentFormatterService= serviceLocator.findService("com.ch5finland.genelec.cms.service.CMSContentFormatterService") > 
38 
39<#-- Article title --> 
40 
41<#if  cmsEntity.getField(profile, "/entity/fields/title")?has_content> 
42    <#assign title = cmsEntity.getLocalizedField(profile, "/entity/fields/title")> 
43<#else> 
44    <#assign title = .vars['reserved-article-title'].data> 
45</#if> 
46 
47<#--  Complete URL  --> 
48<#assign portalUrl = themeDisplay.getPortalURL() > 
49<#assign urlTitle = themeDisplay.getURLCurrent() > 
50<#assign currentURL = portalUrl + urlTitle > 
51 
52<#assign facebook_share_url = themeDisplay.getThemeSetting("facebook_share_url") > 
53<#assign linkedin_share_url = themeDisplay.getThemeSetting("linkedin_share_url") > 
54<#assign twitter_share_url = themeDisplay.getThemeSetting("twitter_share_url") > 
55 
56<#if  cmsEntity.getField(profile, "/entity/assets/mainImage")?has_content> 
57    <#assign mainImg = cmsEntity.getLocalizedField(profile, "/entity/assets/mainImage")> 
58    <#if !mainImg.isNull("url")> 
59        <#assign mainImage = mainImg.url> 
60    <#else> 
61        <#assign mainImage = ""> 
62    </#if> 
63    <#if !mainImg.isNull("description")> 
64        <#assign mainImageDescription = localizeField(mainImg.description, profile.getCMSLangCode())> 
65    <#else> 
66       <#assign mainImageDescription = "">  
67    </#if> 
68</#if> 
69 
70<#assign startDate = "" > 
71<#if cmsEntity.getFieldAsDate("/entity/fields/startDate")?has_content> 
72    <#assign startDate = cmsEntity.getFieldAsDate("/entity/fields/startDate") > 
73</#if> 
74<#assign endDate = "" > 
75<#if cmsEntity.getFieldAsDate("/entity/fields/endDate")?has_content> 
76    <#assign endDate = cmsEntity.getFieldAsDate("/entity/fields/endDate") > 
77</#if> 
78 
79<@appendHTMLMetas currentURL cmsEntity "article" /> 
80 
81<div class="article-page"> 
82 
83    <div class="article-page-background" style="background-image: url(${mainImage})"></div> 
84 
85    <div class="row"> 
86        <div class="col-12"> 
87            <h1 class="article-heading">${title}</h1> 
88                <#if startDate?has_content> 
89                    <h3 class="event-date"> 
90                    <#if !endDate?has_content> 
91                        ${startDate?string("d.M.yyyy")} 
92                    <#elseif startDate?string("d") != endDate?string("d") || startDate?string("M") != endDate?string("M")> 
93                        <#if startDate?string("d") != endDate?string("d") && startDate?string("M") != endDate?string("M")> 
94                            ${startDate?string("d.M.")} - ${endDate?string("d.M.yyyy")} 
95                        <#else> 
96                            ${startDate?string("d.")} - ${endDate?string("d.M.yyyy")} 
97                        </#if> 
98                    <#else> 
99                        ${startDate?string("d.M.yyyy")} 
100                    </#if> 
101                </h3>         
102                </#if>             
103             
104        </div> 
105    </div> 
106 
107    <div class="row"> 
108        <div class="col-12"> 
109            <div class="article-share-buttons"> 
110 
111                <a href="${facebook_share_url}${currentURL}" target="_blank"> 
112                    <span class="fa-stack fa-md">  
113                        <i class="fas fa-circle fa-stack-2x icon-dark"></i>  
114                        <i class="fab fa-facebook-f fa-stack-1x fa-inverse"></i>  
115                    </span> 
116                </a> 
117 
118                <a href="${linkedin_share_url}${currentURL}" target="_blank"> 
119                    <span class="fa-stack fa-md">  
120                        <i class="fas fa-circle fa-stack-2x icon-dark"></i>  
121                        <i class="fab fa-linkedin-in fa-stack-1x fa-inverse"></i>  
122                    </span> 
123                </a> 
124 
125                <a href="mailto:?subject=${title}&amp;body=${title} ${currentURL}" 
126   title="${title}" target="_blank"> 
127                    <span class="fa-stack fa-md">  
128                        <i class="fas fa-circle fa-stack-2x icon-dark"></i>  
129                        <i class="fas fa-envelope fa-stack-1x fa-inverse"></i>  
130                    </span> 
131                </a> 
132                 
133                <a href="${twitter_share_url}${currentURL}" target="_blank"> 
134                    <span class="fa-stack fa-md">  
135                        <i class="fas fa-circle fa-stack-2x icon-dark"></i>  
136                        <i class="fab fa-twitter fa-stack-1x fa-inverse"></i>  
137                    </span> 
138                </a> 
139 
140            </div> 
141            <div class="article-date"> 
142 
143            </div> 
144        </div> 
145    </div> 
146 
147    <div class="row article-page-main-image"> 
148        <div class="col-12"> 
149            <#if mainImage?has_content> 
150                <picture> 
151                    <source srcset="${mainImage}?w=1250&q=80&fm=webp" type="image/webp" /> 
152                    <img class="article-image" src="${mainImage}?w=1250&q=80&fm=jpg" alt="${mainImageDescription}">    
153                </picture> 
154            </#if> 
155        </div> 
156    </div>  
157     
158    <div class="article-section mt-5"> 
159        <div class="row"> 
160            <div class="col-xs-12 col-lg-8 col-xl-9"> 
161                <div class="product-page-intro mt-0"> 
162                    <#if  cmsEntity.getLocalizedField(profile, "/entity/fields/summary")?has_content> 
163                        ${cmsEntity.getLocalizedField(profile, "/entity/fields/summary")} 
164                    </#if> 
165                </div> 
166                <div> 
167                    <#if  cmsEntity.getLocalizedField(profile, "/entity/fields/content")?has_content> 
168                        <#--  ${cmsEntity.getLocalizedField(profile, "/entity/fields/content")}  --> 
169                        ${cmsContentFormatterService.getMarkdown(cmsEntity.getLocalizedField(profile, "/entity/fields/content"), 930)} 
170                    </#if> 
171 
172                    <#--  <#assign summary = cmsContentFormatterService.getMarkdown(cmsEntity.getLocalizedField(profile, "/entity/fields/content"))>  --> 
173 
174 
175                </div> 
176 
177<@showVideos cmsEntity/> 
178 
179            </div> 
180            <div class="col-xs-12 col-lg-4 col-xl-3"> 
181             
182            <#-- ---- Right column ----  --> 
183             
184             
185                <div class="venue"> 
186                    <#if cmsEntity.getLocalizedField(profile, "/entity/fields/venueName")?has_content> 
187                        <h3>${cmsEntity.getLocalizedField(profile, "/entity/fields/venueName")}</h3> 
188                    <#else> 
189                        <h3>${t.locationTitle}</h3> 
190                    </#if> 
191                     
192                <#if  cmsEntity.getLocalizedField(profile, "/entity/fields/streetAddress")?has_content> 
193                    <span class="d-block">${cmsEntity.getLocalizedField(profile, "/entity/fields/streetAddress")}</span> 
194                </#if> 
195                <#if  cmsEntity.getLocalizedField(profile, "/entity/fields/city")?has_content> 
196                    <span class="d-block">${cmsEntity.getLocalizedField(profile, "/entity/fields/city")}</span> 
197                </#if> 
198                <#if  cmsEntity.getLocalizedField(profile, "/entity/fields/country")?has_content> 
199                    <span class="d-block">${cmsEntity.getLocalizedField(profile, "/entity/fields/country")}</span> 
200                </#if> 
201                <#if  cmsEntity.getField(profile, "/entity/fields/url")?has_content> 
202                    <p> 
203                        <a href="${cmsEntity.getField(profile, "/entity/fields/url")}"> 
204                            ${cmsEntity.getField(profile, "/entity/fields/url")} 
205                        </a> 
206                    </p> 
207                </#if>                  
208                </div> 
209                 
210                <#if  cmsEntity.getField(profile, "/entity/fields/coordinates")?has_content> 
211                    <#assign coordStr = cmsEntity.getField(profile, "/entity/fields/coordinates") > 
212                    <#if coordStr?contains(",")> 
213                        <#assign lat = coordStr?split(",")[0]> 
214                        <#assign lng = coordStr?split(",")[1]> 
215                         
216                        <#if lat?has_content && lng?has_content> 
217                        <div id="location-map" style="height: 290px;"> </div> 
218                        <script> 
219                          var map; 
220                          var venueLatLng = {lat: ${lat}, lng: ${lng}}; 
221                          function initMap() { 
222                            map = new google.maps.Map(document.getElementById('location-map'), { 
223                              center: venueLatLng, 
224                              zoom: 11, 
225                              disableDefaultUI: true, 
226                              fullscreenControl: true, 
227                              zoomControl: true 
228                            }); 
229                            var marker = new google.maps.Marker({ 
230                              position: venueLatLng, 
231                              map: map 
232                            }); 
233
234                        </script> 
235                        <script src="//maps.googleapis.com/maps/api/js?key=${googleMapsAPIKey}&callback=initMap" 
236    async defer></script> 
237                        </#if> 
238                    </#if> 
239                </#if> 
240            <#-- //-- Right column ----  --> 
241             
242            </div> 
243        </div> 
244    </div>     
245</div> 
246 
247 
248<style> 
249     
250    .event-date { 
251        padding-left: 23px; 
252
253 
254 
255</style> 
256 
257<script> 
258$('.relatedProduct-carousel').owlCarousel({ 
259    loop:false, 
260    nav:true, 
261    dots:false, 
262    margin:5, 
263    lazyLoad:true, 
264    navText : ['<i class="icon-angle-left">','<i class="icon-angle-right">'], 
265    responsive:{ 
266        0:{items:1, slideBy:1}, 
267        600:{items:3, slideBy:3}, 
268        1000:{items:6, slideBy:6} 
269    }, 
270}) 
271 
272 
273</script>