Mining takes on the sustainability challenge - article

An error occurred while processing the template.
The following has evaluated to null or missing:
==> (PortletPreferencesLocalService.getPortletPreferences(themeDisplay.getPlid(), portletId)?first)  [in template "20116#20152#33020" at line 46, column 53]

----
Tip: If the failing expression is known to 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 portletPreferencesXML = saxRe...  [in template "20116#20152#33020" at line 46, column 1]
----
1<#-- 
2Web content templates are used to lay out the fields defined in a web 
3content structure. 
4 
5Please use the left panel to quickly add commonly used variables. 
6Autocomplete is also available and can be invoked by typing "${". 
7--> 
8 
9<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")> 
10<#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")> 
11<#assign AssetLinkLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetLinkLocalService")> 
12<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")> 
13<#assign AssetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")> 
14<#assign AssetCategoryPropertyLocalService = serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService")/> 
15<#assign LayoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")> 
16<#assign PortletPreferencesLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.PortletPreferencesLocalService")/> 
17<#assign PropertyFactoryUtil = serviceLocator.findService("com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil") /> 
18<#assign GroupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService")> 
19<#assign LayoutSetService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutSetLocalService")> 
20<#assign DynamicQueryFactoryUtil = serviceLocator.findService("com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil") /> 
21<#assign virtualHostLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.VirtualHostLocalService") /> 
22<#assign TemplateCustomService = serviceLocator.findService("template.custom.services.TemplateCustomService") /> 
23<#assign ArticleTemplateCustomService = serviceLocator.findService("template.custom.services.ArticleTemplateCustomService") /> 
24 
25<#assign 
26serviceContextThreadLocal = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"] 
27themeDisplay = serviceContextThreadLocal.getServiceContext().getThemeDisplay() 
28/> 
29 
30<#assign CurrentJournalArticle = JournalArticleLocalService.getLatestArticle(groupId,.vars['reserved-article-id'].data)> 
31<#assign CurrentAssetEntry = AssetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle",CurrentJournalArticle.getResourcePrimKey())> 
32<#assign AssetLinks=AssetLinkLocalService.getDirectLinks(CurrentAssetEntry.getEntryId()) > 
33 
34<#assign PropertyFactoryUtil = serviceLocator.findService("com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil") /> 
35 
36<#-- update name here if change asset library name --> 
37<#assign assetLibGroup = GroupLocalService.getGroup(themeDisplay.getCompanyId(), "Kearney Global Asset Library") /> 
38<#if assetLibGroup?? > 
39	<#assign assetLibGroupId = assetLibGroup.getGroupId() /> 
40</#if> 
41     
42<#assign assetLinkOrder = CurrentJournalArticle.getExpandoBridge().getAttribute("Related Asset Ordering")!"" /> 
43 
44<#-- ATK 40 changes start --> 
45<#assign portletId = themeDisplay.getPortletDisplay().getId()> 
46<#assign portletPreferencesXML = saxReaderUtil.read((PortletPreferencesLocalService.getPortletPreferences(themeDisplay.getPlid(), portletId)?first).getPreferences())> 
47 
48<#-- Macro used to get specific field text from an Asset Entry --> 
49<#macro entryNode document field> 
50    <#if document.selectSingleNode("/root/dynamic-element[@name='"+field+"']/dynamic-content")??> 
51    "${document.selectSingleNode("/root/dynamic-element[@name='"+field+"']/dynamic-content").getText()?js_string}" 
52    <#else> 
53    "" 
54    </#if> 
55</#macro> 
56 
57<#-- Macro used to get specific portlet preference --> 
58<#macro preference prefKey prefIndex defaultValue> 
59    <#if portletPreferencesXML.selectSingleNode("/portlet-preferences/preference[name='"+prefKey+"-"+prefIndex+"']/value")??> 
60    "${portletPreferencesXML.selectSingleNode("/portlet-preferences/preference[name='"+prefKey+"-"+prefIndex+"']/value").getText()?js_string}"<#return> 
61    <#else> 
62    "${defaultValue?js_string}"<#return> 
63    </#if> 
64</#macro> 
65<#-- ATK 40 changes end --> 
66<#-- ATK-659 --> 
67<#assign displayDate = "" /> 
68<#if CurrentJournalArticle.getDisplayDate()?has_content> 
69    <#assign displayDate = CurrentJournalArticle.getDisplayDate()?date?string('MMMM dd, yyyy') /> 
70</#if> 
71<#--  schema vars starts  --> 
72<#assign modifiedDate = "" /> 
73<#if CurrentJournalArticle.getModifiedDate()?has_content> 
74    <#assign modifiedDate = CurrentJournalArticle.getModifiedDate()?date?string('yyyy-MM-dd') /> 
75</#if> 
76<#assign displayDateForSchema = "" /> 
77<#if CurrentJournalArticle.getDisplayDate()?has_content> 
78    <#assign displayDateForSchema = CurrentJournalArticle.getDisplayDate()?date?string('yyyy-MM-dd') /> 
79</#if> 
80<#assign imageurlpartial = "" /> 
81<#assign imageurlschema = "" /> 
82<#assign currenturi = "" /> 
83<#if (ThumbnailSquare.getData())??> 
84    <#if (ThumbnailSquare.getData())?contains("?")> 
85        <#assign imageurlpartial = (ThumbnailSquare.getData())?keep_before("?") /> 
86    <#else> 
87        <#assign imageurlpartial =  ThumbnailSquare.getData() />     
88    </#if>     
89    <#assign imageurlschema = themeDisplay.getCDNBaseURL() + imageurlpartial /> 
90</#if> 
91<#if themeDisplay.getURLCurrent()?has_content > 
92    <#if (themeDisplay.getURLCurrent())?contains("?") > 
93        <#assign currenturi = (themeDisplay.getURLCurrent())?keep_before("?") /> 
94    <#else> 
95        <#assign currenturi = (themeDisplay.getURLCurrent()) /> 
96    </#if> 
97</#if>     
98<#assign pageurlcurrent = themeDisplay.getCDNBaseURL() + currenturi /> 
99<#assign answer =''> 
100<#if Intro.getData()?has_content > 
101	    <#assign answer = Intro.getData()/> 
102	 <#else> 
103	    <#if Content.getSiblings()?has_content> 
104	        <#list Content.getSiblings() as cur_Content> 
105		        <#if (cur_Content.getData())??> 
106		            <#assign withouthtml = cur_Content.getData()?replace('<[^>]+>','','r') /> 
107		            <#assign withouthtml = withouthtml?replace('\\n+','','r') /> 
108		            <#assign withouthtml = withouthtml?replace('\\t+','','r') /> 
109		            <#assign withouthtml = withouthtml?replace('\\r+','','r') /> 
110		            <#assign withouthtml = withouthtml?replace('&nbsp;','','r') /> 
111			        <#assign answer += withouthtml /> 
112		        </#if> 
113	        </#list> 
114        </#if> 
115</#if> 
116<#--  schema ends --> 
117<div id="articleDiv"> 
118</div> 
119 
120<script> 
121 
122	var articleMetadata = {}; 
123	articleMetadata.slug = "${Slug.getData()?js_string}"; 
124	articleMetadata.articleTitle = "${ArticleTitle.getData()?js_string}"; 
125 
126	<#if HeroImage??> 
127	    articleMetadata.heroImage = "${HeroImage.getData()?js_string}"; 
128	</#if> 
129	<#if HeroMobile??> 
130	    articleMetadata.heroMobile = "${HeroMobile.getData()?js_string}"; 
131	</#if> 
132 
133	<#-- 
134	Set articleMetadata.publicTestArticle to restrict social sharing functionality to a single article. 
135	Otherwise, leave commented to allow social sharing on all articles. 
136	--> 
137	<#--articleMetadata.publicTestArticle = 'test-article-url';--> 
138 
139 
140	<#if SmallerTitle??> 
141    articleMetadata.smallerTitle = ${getterUtil.getBoolean(SmallerTitle.getData())?c}; 
142	<#else> 
143    articleMetadata.smallerTitle = false; 
144	</#if> 
145 
146	articleMetadata.subtitle = "${Subtitle.getData()?js_string}"; 
147	articleMetadata.intro = "${Intro.getData()?js_string}"; 
148 
149	<#if LandingPage??> 
150            articleMetadata.landingPage = '${getterUtil.getBoolean(LandingPage.getData())?c}'; 
151	<#else> 
152            articleMetadata.landingPage = false; 
153	</#if> 
154 
155	<#if SocialLinks??> 
156    	articleMetadata.socialLinks = ${getterUtil.getBoolean(SocialLinks.getData())?c}; 
157	<#else> 
158    	articleMetadata.socialLinks = true; 
159	</#if> 
160	 
161	<#if GraySeparator??> 
162    	articleMetadata.graySeparator = ${getterUtil.getBoolean(GraySeparator.getData())?c}; 
163	<#else> 
164    	articleMetadata.graySeparator = false; 
165	</#if> 
166 
167	<#if ShowParentBreadcrumb?? && LandingPage?? && getterUtil.getBoolean(LandingPage.getData()) == true> 
168        articleMetadata.showParentBreadcrumb = ${getterUtil.getBoolean(ShowParentBreadcrumb.getData())?c} 
169	<#else> 
170            articleMetadata.showParentBreadcrumb = true; 
171	</#if> 
172 
173    <#if BreadcrumbLabel??> 
174        articleMetadata.parentBreadcrumbLabel = "${BreadcrumbLabel.getData()?js_string}"; 
175	</#if> 
176 
177    <#if BreadcrumbURL??> 
178        articleMetadata.parentBreadcrumbURL = "${BreadcrumbURL.getData()?js_string}"; 
179	</#if> 
180 
181	<#if Byline??> 
182	articleMetadata.byline = "${Byline.getData()?js_string}"; 
183	</#if> 
184 
185	<#if FeaturedContributor??> 
186    articleMetadata.featuredContributor = "${FeaturedContributor.getData()}" 
187	</#if> 
188 
189	<#if PostArticleSlideShareKey?? && PostArticleSlideShareKey.PostArticleSlideshareContent??> 
190    articleMetadata.postArticleSlideshareKey = "${PostArticleSlideShareKey.getData()}" 
191 
192    articleMetadata.postArticleSlideshareContent = "${PostArticleSlideShareKey.PostArticleSlideshareContent.getData()}" 
193	</#if> 
194 
195	<#if PDF??> 
196    articleMetadata.pdf = "${PDF.getData()?js_string}" 
197	<#else> 
198    articleMetadata.pdf = ""; 
199	</#if> 
200 
201	var articleContents = []; 
202	<#if Content.getSiblings()?has_content> 
203		<#list Content.getSiblings() as cur_Content> 
204 
205        var images = []; 
206 
207			<#if cur_Content.PrimaryImage?has_content> 
208				<#list cur_Content.PrimaryImage.getSiblings() as cur_PrimaryImage> 
209 
210                var image = {"imageURL": "${cur_PrimaryImage.getData()?js_string}"}; 
211 
212					<#if cur_Content.PrimaryImage.SlideshowCaption??> 
213                        image["caption"] = "${cur_PrimaryImage.SlideshowCaption.getData()?js_string}"; 
214					</#if> 
215 
216                    image["sharingEnabled"] = ${(cur_PrimaryImage.SharingEnabled?? && cur_PrimaryImage.SharingEnabled.getData() == "true")?c}; 
217 
218                images.push(image); 
219 
220				</#list> 
221			</#if> 
222 
223        articleContents.push({ 
224            <#if cur_Content.FeatureSlug??> 
225			slug: "${cur_Content.FeatureSlug.getData()?js_string}", 
226			</#if> 
227			<#if cur_Content.TextAlignment??> 
228			textAlignment: "${cur_Content.TextAlignment.getData()?js_string}", 
229			</#if> 
230			content: "${cur_Content.getData()?js_string}", 
231			styling: "${cur_Content.stylingSelect.getData()?js_string}", 
232			alternateText: "${cur_Content.AlternateText.getData()?js_string}", 
233			primaryImage: images, 
234			secondaryImage: "${cur_Content.SecondaryMaskImage.getData()?js_string}", 
235			buttonText: "${cur_Content.ButtonText.getData()?js_string}", 
236			buttonURL: "${cur_Content.ButtonURL.getData()?js_string}", 
237			displayDate: "${displayDate}" 
238		}); 
239 
240 
241		</#list> 
242	</#if> 
243	 
244	var bios = []; 
245	<#assign articleGroup = GroupLocalService.getGroup(CurrentAssetEntry.getGroupId()) 
246		guestGroup = GroupLocalService.getFriendlyURLGroup(articleGroup.getCompanyId(), "/guest") /> 
247	<#-- 
248		Create list of groups that asset entries live in, so that linked bios can be retrieved by UUID 
249	--> 
250	<#assign assetLinkGroups = []> 
251	<#if AssetLinks?has_content> 
252		<#list AssetLinks as assetLink> 
253			<#assign linkedAssetEntry = AssetEntryLocalService.getAssetEntry(assetLink.getEntryId2())> 
254			<#assign assetLinkGroups = assetLinkGroups + [linkedAssetEntry.getGroupId()]> 
255		</#list> 
256	</#if> 
257 
258	//Create asset link ordering 
259	var assetOrderArr = []; 
260 
261	<#list assetLinkOrder?split(",") as assetLinkUUID> 
262		<#-- 
263			Find group which asset link is stored in and assign the resulting asset entry 
264		--> 
265		<#assign orderAssetEntry = ""> 
266 
267		<#list assetLinkGroups as assetLinkGroupId> 
268			<#assign orderAssetEntry = AssetEntryLocalService.fetchEntry(assetLinkGroupId, assetLinkUUID)!""> 
269 
270			<#if orderAssetEntry != ""> 
271				<#break /> 
272			</#if> 
273		</#list> 
274 
275		<#if orderAssetEntry != ""> 
276			<#assign orderJournalArticle = JournalArticleLocalService.fetchLatestArticle(orderAssetEntry.getClassPK())!""> 
277            <#if orderJournalArticle != ""> 
278	            assetOrderArr.push("${orderJournalArticle.getArticleId()}"); 
279            </#if> 
280		</#if> 
281	</#list> 
282 
283	var assetOrderMap = {}; 
284 
285	for(var order=1; order<assetOrderArr.length; order++) { 
286		assetOrderMap[assetOrderArr[order-1]] = order; 
287
288 
289	var getAssetOrder = function(uuid) { 
290		var order = assetOrderMap[uuid]; 
291		if(!order) { 
292			order = Object.keys(assetOrderMap).length + 1; 
293			assetOrderMap[uuid] = order; 
294
295 
296		return order; 
297	}; 
298	<#assign authorlistschema = [] /> 
299	<#if Authors?? && Authors.getSiblings()?has_content> 
300         
301        var bioC =0; 
302        	<#list Authors.getSiblings() as cur_Authors> 
303        	      
304        		<#if  cur_Authors.getData() != "" > 
305            	    <#assign cur_webContent_map = jsonFactoryUtil.createJSONObject(cur_Authors.getData())> 
306                    <#assign cur_webContent_classPK = cur_webContent_map.getString("classPK")> 
307                    <#if cur_webContent_classPK??> 
308            		    <#if JournalArticleLocalService.fetchLatestArticle(cur_webContent_classPK?number)??> 
309		                    <#assign articleK = JournalArticleLocalService.fetchLatestArticle(cur_webContent_classPK?number)> 
310	            		    <#assign articleKAssetEntry = AssetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle",articleK.getResourcePrimKey()) /> 
311	            		  
312		            		<#if articleKAssetEntry?? && articleKAssetEntry.getAssetRenderer()??> 
313								<#assign xml = saxReaderUtil.read(articleKAssetEntry.getAssetRenderer().getArticle().getContentByLocale(themeDisplay.getLocale())) /> 
314			            		  
315			            		  
316			            		   
317			            		 <#assign xml_fullName = xml.valueOf("//dynamic-element[@name='FullName']/dynamic-content/text()") /> 
318			            		 <#assign xml_title = xml.valueOf("//dynamic-element[@name='Title']/dynamic-content/text()") /> 
319			            		 <#assign xml_headshot = TemplateCustomService.getDocumentURL(xml,"CutoutHeadshot",themeDisplay)/> 
320			            		 
321			            		  
322			            		  var bio1 = {}; 
323			                      bio1.structureKey=('${articleK.getDDMStructure().getName("en_US")}'); 
324			                      bio1.weight=  ++bioC; 
325			            		  bio1.fullName = '${xml_fullName}'; 
326			            		  bio1.headshot = '${xml_headshot?js_string}'; 
327			            		  bio1.title = '${xml_title}'; 
328				            	  <#if (articleGroup.getLiveGroupId() != 0 ) >	 
329										<#assign articleK = JournalArticleLocalService.getArticleByUrlTitle(assetLibGroupId, articleK.getUrlTitle()) />	 
330								  </#if>	 
331								  <#assign viewURL = '' /> 
332								 
333								 <#if articleK.getDDMStructure().getName("en_US") == "Bio Page"> 
334								 	 <#assign viewURL = themeDisplay.getPortalURL() + "/about-us/our-people/bio/" + xml_fullName?lower_case?replace(" ", "-")/> 
335								 </#if> 
336								 
337								bio1.bioURL = '${viewURL}';	 
338								bios.push(bio1); 
339								 
340								<#assign viewURLschema = ''/> 
341								<#if viewURL?has_content> 
342								    <#assign viewURLschema =  viewURL /> 
343								</#if> 
344								<#assign authordataschema = {"url":viewURLschema, "jobTitle":xml_title, "name":xml_fullName} /> 
345			            		<#assign authorlistschema = authorlistschema + [authordataschema] /> 
346							 </#if>            		 	 
347						</#if>	 
348					</#if> 
349            	</#if> 
350        		   
351        	</#list> 
352        	 
353    </#if> 
354	 
355	<#assign oldwaytogetauthourforschema = false> 
356	<#if authorlistschema?size == 0> 
357		<#assign oldwaytogetauthourforschema = true> 
358	</#if>		 
359	 
360    if (bios.length == 0){ 
361		<#if AssetLinks?has_content> 
362 
363			<#list AssetLinks as assetLink> 
364				<#assign linkedAssetEntry = AssetEntryLocalService.getAssetEntry(assetLink.getEntryId2())> 
365				<#assign linkedJournalArticle = JournalArticleLocalService.getLatestArticle(linkedAssetEntry.getClassPK())> 
366				<#assign xml = saxReaderUtil.read(linkedAssetEntry.getAssetRenderer().getArticle().getContentByLocale(themeDisplay.getLocale())) /> 
367				<#assign structureKey =  linkedJournalArticle.getDDMStructure().getName("en_US") /> 
368				 
369			var bio = {}; 
370			 
371            <#assign xml_headshot = TemplateCustomService.getDocumentURL(xml,"CutoutHeadshot",themeDisplay)/>						 
372				<#if structureKey == "Bio Page" || structureKey == "Micro Bio" > 
373						<#assign xml_fullName = xml.valueOf("//dynamic-element[@name='FullName']/dynamic-content/text()") /> 
374						<#assign xml_title = xml.valueOf("//dynamic-element[@name='Title']/dynamic-content/text()") /> 
375						bio.structureKey=('${structureKey}').trim(); 
376						bio.weight = getAssetOrder("${linkedJournalArticle.getArticleId()}"); 									 
377						bio.fullName = "${xml_fullName}"; 
378						bio.position = "${xml.valueOf("//dynamic-element[@name='Position']/dynamic-content/text()")?js_string}"; 
379						bio.title = "${xml_title?js_string}"; 
380						bio.headshot = "${xml_headshot?js_string}"; 
381						bio.description = "${xml.valueOf("//dynamic-element[@name='Description']/dynamic-content/text()")?js_string}"; 
382						bio.linkedInURL = "${xml.valueOf("//dynamic-element[@name='LinkedInURL']/dynamic-content/text()")?js_string}"; 
383						 
384						<#assign viewURL = '' /> 
385						<#if linkedJournalArticle.getDDMStructure().getName("en_US") == "Bio Page"> 
386								<#assign viewURL = themeDisplay.getPortalURL() + "/about-us/our-people/bio/" + xml_fullName?lower_case?replace(" ", "-")/> 
387						</#if> 
388										 
389						bio.bioURL = '${viewURL}';	 
390						bios.push(bio); 
391						 
392						<#assign viewURLschema = ''/> 
393						<#if viewURL?has_content> 
394						    <#assign viewURLschema =  viewURL /> 
395						</#if> 
396						 
397						<#if oldwaytogetauthourforschema> 
398							<#assign authordataschema = {"url":viewURLschema, "jobTitle":xml_title, "name":xml_fullName} /> 
399							<#assign authorlistschema = authorlistschema + [authordataschema] /> 
400						</#if>	 
401				</#if> 
402			</#list> 
403 
404			bios.sort(function(bio1, bio2){ 
405				return bio1.weight - bio2.weight; 
406			}); 
407		</#if> 
408 
409
410	<#assign assetCategories = AssetCategoryLocalService.getAssetEntryAssetCategories(CurrentAssetEntry.getEntryId())> 
411 
412	var articleCategories = []; 
413 
414	<#list assetCategories as category> 
415		<#assign categoryVocabulary = AssetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId())> 
416		<#assign categoryUrl = "#"> 
417 
418		<#list AssetCategoryPropertyLocalService.getCategoryProperties(category.categoryId) as categoryProperty> 
419 
420			<#if categoryProperty.key == "url"> 
421				<#assign categoryUrl = categoryProperty.value> 
422			</#if> 
423		</#list> 
424 
425    articleCategories.push({ 
426		id: "${category.categoryId}", 
427		name: "${category.name}", 
428		url: "${categoryUrl}", 
429		vocabularyName: "${categoryVocabulary.getName()?js_string}", 
430	}); 
431	</#list> 
432 
433	articleMetadata.categories = articleCategories; 
434	<#if LayoutSetService.getLayoutSet(articleGroup.getGroupId(), false)?? 
435	&& LayoutSetService.getLayoutSet(articleGroup.getGroupId(), false).getThemeSetting("isMicroSite", "regular")?? > 
436		<#assign isMicroSite = (LayoutSetService.getLayoutSet(articleGroup.getGroupId(), false).getThemeSetting("isMicroSite", "regular") == "true")> 
437	<#else> 
438		<#assign isMicroSite = false> 
439	</#if> 
440 
441	articleMetadata.isMicroSite = ${isMicroSite?c}; 
442	articleMetadata.groupName = "${articleGroup.getName("en_US")?js_string}"; 
443	articleMetadata.groupFriendlyUrl = "${articleGroup.getFriendlyURL()?js_string}"; 
444 
445	<#if ReadMoreURL??> 
446    articleMetadata.readMoreURL = "${ReadMoreURL.getData()?js_string}"; 
447	<#else> 
448    articleMetadata.readMoreURL = ""; 
449	</#if> 
450 
451	<#if ReadMoreTextOverride??> 
452    articleMetadata.readMoreTextOverride = "${ReadMoreTextOverride.getData()?js_string}"; 
453	<#else> 
454    articleMetadata.readMoreTextOverride = ""; 
455	</#if> 
456 
457	<#if ContributorsTitleOverride??> 
458    articleMetadata.contributorsTitleOverride = "${ContributorsTitleOverride.getData()?js_string}"; 
459	<#else> 
460    articleMetadata.contributorsTitleOverride = ""; 
461	</#if> 
462 
463	<#if ReadMoreOverlay??> 
464            articleMetadata.readMoreOverlay = ${getterUtil.getBoolean(ReadMoreOverlay.getData())?c} 
465	<#else> 
466            articleMetadata.readMoreOverlay = false; 
467	</#if> 
468	 
469	var sidebarContents = []; 
470	<#assign enableSidebar = false> 
471	<#if EnableSidebar??> 
472		<#assign enableSidebar = getterUtil.getBoolean(EnableSidebar.getData())> 
473	</#if> 
474	<#-- Check if Sidebar is enabled or not --> 
475	<#if enableSidebar == true> 
476	      
477	     <#assign listingOfArticles = false> 
478	     <#assign singleAssetWithImage = false> 
479	     <#assign richTextSection = false> 
480	     <#assign listView = false> 
481	     <#if EnableSidebar.ListingOfArticles??>  
482	     	 <#assign listingOfArticles = getterUtil.getBoolean(EnableSidebar.ListingOfArticles.getData())> 
483	     </#if> 
484	     <#if EnableSidebar.SingleAssetWithImage??> 
485	     	 <#assign singleAssetWithImage = getterUtil.getBoolean(EnableSidebar.SingleAssetWithImage.getData())> 
486	     </#if> 
487	     <#if EnableSidebar.RichTextSection??> 
488	     	<#assign richTextSection = getterUtil.getBoolean(EnableSidebar.RichTextSection.getData())> 
489	     </#if> 
490	     <#if EnableSidebar.ListView??> 
491	     	<#assign listView = getterUtil.getBoolean(EnableSidebar.ListView.getData())>	 
492	     </#if> 
493	     <#-- If Asset publisher listing of articles is enabled --> 
494	     <#if listingOfArticles == true> 
495	     	 <#assign listOfArticlesTitles = "Related"> 
496	     	 <#if EnableSidebar.ListingOfArticles.ListingOfArticlesTitle.getData()?has_content> 
497	     	 	<#assign listOfArticlesTitles = EnableSidebar.ListingOfArticles.ListingOfArticlesTitle.getData()> 
498	     	 </#if> 	 
499	     	 <#assign manualArticlesEntries = {}> 	 
500	         <#if EnableSidebar.ListingOfArticles.SelectSidebarArticles??> 
501	         		<#assign manualArticlesEntries = ArticleTemplateCustomService.getManualArticleList(EnableSidebar.ListingOfArticles.SelectSidebarArticles.getSiblings())>  
502	         </#if> 
503	          var manualArticlesEntry = []; 
504	         <#if manualArticlesEntries?size &gt; 0 > 
505	         	  	 <#list manualArticlesEntries as curEntry> 
506						 <#assign jArt = JournalArticleLocalService.getLatestArticle(curEntry.getClassPK())> 
507						 <#assign viewURL = TemplateCustomService.getSidebarArticleViewURL(themeDisplay,jArt,assetLibGroup)/> 
508						 var articleEntry = {"articleTitle": "${TemplateCustomService.getSidebarArticleTitle(themeDisplay,jArt,assetLibGroup)}","articleURL":"${viewURL}"}; 
509						 manualArticlesEntry.push(articleEntry);      	  	             	  	        
510	         	  	 </#list> 
511	         <#else> 
512	         		<#assign noOfFeatureArticle = "3"> 
513	         		<#if EnableSidebar.ListingOfArticles.NoOfArticlesDisplayed.getData() != "0"> 
514	         			<#assign noOfFeatureArticle = EnableSidebar.ListingOfArticles.NoOfArticlesDisplayed.getData()>  
515	         		</#if> 
516	         		<#assign manualArticlesEntries = ArticleTemplateCustomService.getRelatedArticles(CurrentAssetEntry.getEntryId(), noOfFeatureArticle, "Any")> 
517	         		<#list manualArticlesEntries as curEntry> 
518						 <#assign jArt = JournalArticleLocalService.getLatestArticle(curEntry.getClassPK())> 
519						 <#assign viewURL = TemplateCustomService.getSidebarArticleViewURL(themeDisplay,jArt,assetLibGroup)/> 
520						 var articleEntry = {"articleTitle": "${TemplateCustomService.getSidebarArticleTitle(themeDisplay,jArt,assetLibGroup)}","articleURL":"${viewURL}"}; 
521						 manualArticlesEntry.push(articleEntry);      	  	             	  	        
522	         	    </#list>  
523	         </#if> 
524	     	sidebarContents.push({ 
525	     		listingOfArticlesTitle:"${listOfArticlesTitles}", 
526	     		manualArticles:manualArticlesEntry, 
527	     		componentType:"listingOfArticles" 
528	     		 
529	     	}); 
530	     </#if> 
531	     <#-- Single Asset Image article --> 
532	     <#if singleAssetWithImage == true> 
533	     	  <#assign learnMoreText = "Learn more"> 
534	     	  <#assign enableTNSImage = true>	 
535	     	  <#assign enableSlug = true>	 
536	     	  <#if (EnableSidebar.SingleAssetWithImage.SingleAssetWithImageArticle.LearnMoreButtonText.getData())??> 
537					 <#assign learnMoreText = EnableSidebar.SingleAssetWithImage.SingleAssetWithImageArticle.LearnMoreButtonText.getData()/> 
538			  </#if> 
539			  <#if EnableSidebar.SingleAssetWithImage.SingleAssetWithImageArticle.EnableTNSImage??> 
540			  		<#assign enableTNSImage = getterUtil.getBoolean(EnableSidebar.SingleAssetWithImage.SingleAssetWithImageArticle.EnableTNSImage.getData())/> 
541			  </#if>	 
542	     	  <#if EnableSidebar.SingleAssetWithImage.SingleAssetWithImageArticle.EnableSlug??> 
543	     			<#assign enableSlug = getterUtil.getBoolean(EnableSidebar.SingleAssetWithImage.SingleAssetWithImageArticle.EnableSlug.getData())>	 
544	     	  </#if>	 
545	          <#assign singleAssetArticleData = jsonFactoryUtil.createJSONObject(EnableSidebar.SingleAssetWithImage.SingleAssetWithImageArticle.getData())/> 
546	          <#if singleAssetArticleData?has_content>  
547	          	<#assign singleAssetArticle = ArticleTemplateCustomService.getManualArticle(EnableSidebar.SingleAssetWithImage.SingleAssetWithImageArticle.getData())> 
548	          	<#assign jArt = JournalArticleLocalService.getLatestArticle(singleAssetArticle.getClassPK())> 
549	          	<#assign document = saxReaderUtil.read(jArt.getContentByLocale(themeDisplay.getLocale()))> 
550	            <#assign structureName = jArt.getDDMStructure().getName("en_US")> 
551	            var componentType = "FEATURED_ARTICLE"; 
552	            var title = <@entryNode document=document field="ArticleTitle"/>; 
553	            var subtitle = <@entryNode document=document field="Subtitle"/>; 
554	            var description = <@entryNode document=document field="Description"/>; 
555    	        if (description == ""){ 
556					description = <@entryNode document=document field="Intro"/>; 
557
558	            var slug = <@entryNode document=document field="Slug"/>; 
559	            var linkTargetOverride = <@entryNode document=document field="LinkTargetOverride"/>; 
560	            if(linkTargetOverride == "" || linkTargetOverride == null){ 
561	            	linkTargetOverride = <@entryNode document=document field="LinkURL"/>; 
562
563	             <#assign articleGroup = GroupLocalService.getGroup(jArt.getGroupId())> 
564            	<#if LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false)??&& LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false).getThemeSetting("isMicroSite", "regular")??> 
565                	<#assign isMicroSite = (LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false).getThemeSetting("isMicroSite", "regular") == "true")> 
566            	<#else> 
567                	<#assign isMicroSite = false> 
568            	</#if> 
569            	var image = '${TemplateCustomService.getDocumentURL(document,"ThumbnailSquare",themeDisplay)}'; 
570            	if (null == image || "" == image) { 
571				image = '${TemplateCustomService.getDocumentURL(document,"Thumbnail",themeDisplay)}'; 
572
573	            if (null == image) { 
574					image = ""; 
575
576				var singleAssetComponent = { 
577					slug: slug, 
578					title: title, 
579					subtitle: subtitle, 
580					description: description, 
581					image: image.trim(), 
582					groupFriendlyUrl: '${articleGroup.getFriendlyURL()}', 
583					isMicrosite: ${isMicroSite?c}, 
584					linkTargetOverride: linkTargetOverride 
585
586	            sidebarContents.push({ 
587	     			singleAssetData:singleAssetComponent, 
588	     			componentType:"singleAsset", 
589	     			learnMoreTextValue:'${learnMoreText}', 
590	     			enableSlugValue:${enableSlug?c}, 
591	     			enableTNSImageValue:${enableTNSImage?c} 
592	     		}); 
593	      	 </#if>  
594	     </#if> 
595	     <#-- Rich Text Section --> 
596	     <#if richTextSection == true> 
597	     		var richTextSectionData = []; 
598	     		<#if EnableSidebar.RichTextSection.RichTextSectionContent.getSiblings()?has_content> 
599				<#list EnableSidebar.RichTextSection.RichTextSectionContent.getSiblings() as richTextData> 
600					<#if (richTextData.getData())??> 
601						<#assign richTextSection = richTextData.getData()> 
602						richTextSectionData.push({ 
603							richTextSectionContent: '${richTextSection?js_string}' 
604						}); 
605					</#if> 
606				</#list> 
607				</#if> 
608	     		 
609	     		sidebarContents.push({ 
610	     			richTextContentData : richTextSectionData, 
611	     			componentType:"richTextContent" 
612	     		}); 
613	     </#if> 
614	     <#-- List View --> 
615	     <#if listView == true> 
616	            var listViewComponentData = []; 
617	            <#assign listViewTitle = "Related">	 
618	     	    <#assign displayListViewTitle = false> 
619	     	    <#if (EnableSidebar.ListView.ListViewTitle.getData())??> 
620					<#assign listViewTitle = EnableSidebar.ListView.ListViewTitle.getData()> 
621				</#if> 
622				<#if (EnableSidebar.ListView.ListViewTitle.getData())??> 
623	     			<#assign displayListViewTitle = getterUtil.getBoolean(EnableSidebar.ListView.ListViewTitle.DisplayListViewTitle.getData())>	 
624	     	    </#if> 
625	     		<#if EnableSidebar.ListView.ListViewText.getSiblings()?has_content> 
626				  <#list EnableSidebar.ListView.ListViewText.getSiblings() as listViewData> 
627						<#assign listView = listViewData.getData()> 
628						<#assign listlink = listViewData.ListViewLink.getData()> 
629						listViewComponentData.push({ 
630						     listViewTitle: '${listView}', 
631						     listViewLink: '${listlink}', 
632						}); 
633			      </#list> 
634		 		</#if> 
635		 		sidebarContents.push({ 
636	     			listViewData:listViewComponentData, 
637	     			componentType:"listView", 
638	     			listViewTitleValue:'${listViewTitle}', 
639	     			displayListViewTitleValue: ${displayListViewTitle?c} 
640	     		}); 
641	     </#if> 
642	 
643	</#if> 
644	ATK.React.App.Article('articleDiv', articleMetadata, articleContents, bios, sidebarContents); 
645 
646	// Run embedded scripts after article renders. 
647	for (var i in articleContents) { 
648 
649		var re = /<script>(.+)<\/script>/gi; 
650		var thisExtractedScript = ['', '']; 
651 
652		while (null != (thisExtractedScript = re.exec(articleContents[i].content))) { 
653			window.eval(thisExtractedScript[1]); 
654
655
656 
657</script> 
658<hr class="after-25-px-phone" style="width: 1000px; display: none;" id="hrfeatureArticle"> 
659<div id="articleAdtDiv_${portletId}" style="margin-top: 50px;margin-bottom: 50px;"> 
660</div> 
661<script> 
662<#assign enableRelatedInsights = false> 
663 
664<#if EnableRelatedInsights??> 
665	<#assign enableRelatedInsights = getterUtil.getBoolean(EnableRelatedInsights.getData())> 
666</#if> 
667<#if enableRelatedInsights == true> 
668 
669<#assign multiArtBehavior = "Two Wide"> 
670<#assign gridTitle = "Related insights"> 
671<#assign noOfFeatureArticle = "2"> 
672<#assign featureDisplayType = "Image Left"> 
673 
674<#assign fullWidthDisplay = "false"> 
675<#assign greyBackground = "false"> 
676<#assign extraSpacer = "None"> 
677<#assign seeAllLink = ""> 
678<#assign seeAllLinkText = ""> 
679<#assign greyBackground = "false"> 
680<#assign extraSpacer = "None"> 
681<#assign autoplay = "false"> 
682<#assign featureDisplayButtonType = "Visible"> 
683<#assign featureDisplayButtonText = ""> 
684 
685<#if GridTitle??> 
686	<#assign gridTitle =  GridTitle.getData()> 
687</#if> 
688<#if gridTitle?has_content> 
689<#else> 
690	<#assign gridTitle =  "Related insights"> 
691</#if> 
692<#if MultipleArticleBehavior??> 
693	<#assign multiArtBehavior =  MultipleArticleBehavior.getData()> 
694</#if> 
695<#if multiArtBehavior?has_content> 
696<#else> 
697	<#assign multiArtBehavior =  "Two Wide"> 
698</#if> 
699<#if NoOfFeatureArticles??> 
700	<#assign noOfFeatureArticle =  NoOfFeatureArticles.getData()> 
701</#if> 
702<#if noOfFeatureArticle?has_content> 
703<#else> 
704	<#assign noOfFeatureArticle =  "2"> 
705</#if> 
706 
707<#if portletPreferencesXML.selectSingleNode("/portlet-preferences/preference[name='featureDisTypeRelatedInsights']/value")??> 
708		<#assign featureDisplayType = portletPreferencesXML.selectSingleNode("/portlet-preferences/preference[name='featureDisTypeRelatedInsights']/value").getText()?js_string> 
709</#if> 
710 
711<#assign jaEntries = {}>  
712<#if RelatedInsightsArticles??> 
713	<#assign jaEntries = ArticleTemplateCustomService.getManualArticleList(RelatedInsightsArticles.getSiblings())>  
714</#if> 
715 
716<#if jaEntries?size == 0 > 
717	<#assign jaEntries = ArticleTemplateCustomService.getRelatedArticles(CurrentAssetEntry.getEntryId(), noOfFeatureArticle, "Any")> 
718</#if> 
719 
720<#if jaEntries?size == 0 > 
721		<#assign gridTitle = " "> 
722<#else> 
723	$('#hrfeatureArticle').css('display','block'); 
724</#if> 
725 
726var entries = []; 
727	<#if jaEntries?size &gt; 0 > 
728        <#list jaEntries as curEntry> 
729 
730            <#assign jArt = JournalArticleLocalService.getLatestArticle(curEntry.getClassPK())> 
731            <#assign document = saxReaderUtil.read(jArt.getContentByLocale(themeDisplay.getLocale()))> 
732 
733            <#assign structureName = jArt.getDDMStructure().getName("en_US")> 
734 
735 
736            var componentType = "FEATURED_ARTICLE"; 
737 
738            var title = <@entryNode document=document field="ArticleTitle"/>; 
739 
740            var subtitle = <@entryNode document=document field="Subtitle"/>; 
741 
742            var description = <@entryNode document=document field="Description"/>; 
743            if (description == ""){ 
744				description = <@entryNode document=document field="Intro"/>; 
745
746 
747            var slug = <@entryNode document=document field="Slug"/>; 
748 
749            <#assign articleGroup = GroupLocalService.getGroup(jArt.getGroupId())> 
750 
751            <#if LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false)?? 
752            && LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false).getThemeSetting("isMicroSite", "regular")?? > 
753                <#assign isMicroSite = (LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false).getThemeSetting("isMicroSite", "regular") == "true")> 
754            <#else> 
755                <#assign isMicroSite = false> 
756            </#if> 
757 
758            var image = '${TemplateCustomService.getDocumentURL(document,"ThumbnailSquare",themeDisplay)}';  
759            if (null == image || "" == image || ${(fullWidthDisplay == "true")?c}) { 
760				image = '${TemplateCustomService.getDocumentURL(document,"Thumbnail",themeDisplay)}'; 
761
762            if (null == image) { 
763				image = ""; 
764
765 
766            var componentData = { 
767				locale: "${locale}", 
768				structureName: "${structureName}", 
769				displayType: "${featureDisplayType}", 
770				slug: slug, 
771				title: title, 
772				subtitle: subtitle, 
773				description: description, 
774				image: image.trim(), 
775				groupFriendlyUrl: '${articleGroup.getFriendlyURL()}', 
776				isMicrosite: ${isMicroSite?c}, 
777				multiArtBehavior: '${multiArtBehavior}', 
778                featureDisplayButtonText: '${featureDisplayButtonText}', 
779                featureDisplayButtonType: '${featureDisplayButtonType}', 
780				componentType: componentType 
781			}; 
782            <#if structureName == "Article"> 
783 
784                var linkTargetOverride = <@entryNode document=document field="LinkTargetOverride"/>; 
785 
786                if (linkTargetOverride !== ""){ 
787					componentData.link = linkTargetOverride; 
788				} else { 
789                    <#assign assetCategories = AssetCategoryLocalService.getAssetEntryAssetCategories(curEntry.getEntryId())> 
790 
791					var articleCategories = []; 
792 
793                    <#list assetCategories as category> 
794                        <#assign categoryVocabulary = AssetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId())> 
795                        <#assign categoryUrl = "#"> 
796 
797                        <#list AssetCategoryPropertyLocalService.getCategoryProperties(category.categoryId) as categoryProperty> 
798 
799                            <#if categoryProperty.key == "url"> 
800                                <#assign categoryUrl = categoryProperty.value> 
801                            </#if> 
802                        </#list> 
803	 
804                        articleCategories.push({ 
805							id: "${category.categoryId}", 
806							name: "${category.name}", 
807							url: "${categoryUrl}", 
808							vocabularyName: "${categoryVocabulary.getTitle(locale)}", 
809						}); 
810				    
811                    </#list> 
812 
813 
814					componentData.categories = articleCategories; 
815					componentData.urlTitle = "${jArt.getUrlTitle()?js_string}"; 
816
817 
818                var byline = <@entryNode document=document field="Byline"/>; 
819                if (byline != null && byline != ""){ 
820					componentData.byline = []; 
821				};    
822            </#if> 
823            entries.push(componentData); 
824         </#list> 
825    </#if> 
826 
827var extraProps = { 
828			multiArtBehavior: "${multiArtBehavior}", 
829			gridTitle: "${gridTitle}", 
830			fullWidthDisplay: "${fullWidthDisplay}", 
831			greyBackground: "${greyBackground}", 
832			extraSpacer: "${extraSpacer}", 
833			seeAllLink: "${seeAllLink}", 
834			seeAllLinkText: "${seeAllLinkText}" 
835		}; 
836        ATK.React.Component.FeaturedMultiDisplay("articleAdtDiv_${portletId?js_string}", extraProps, entries); 
837</#if> 
838</script> 
839 
840<#compress> 
841<#if Slug.getData()?lower_case == "article" > 
842	<script id ="article-structured-data" type="application/ld+json"> 
843
844		  "@context": "https://schema.org", 
845		  "@type": "Article", 
846		  "dateModified" : "${modifiedDate}", 
847		  "datePublished": "${displayDateForSchema}", 
848		  <#if (ArticleTitle.getData())?has_content>"headline": "${ArticleTitle.getData()?json_string}",</#if> 
849		  <#if answer?has_content>"description" : "${answer?json_string}",</#if> 
850		  <#if imageurlschema?has_content>"image" : "${imageurlschema}",</#if> 
851		  "mainEntityOfPage": { 
852		        "@type": "WebPage", 
853		        "@id": "${pageurlcurrent}" 
854		    }, 
855		  "author" : [ 
856		  <#if (authorlistschema?size > 0)> 
857		    <#list authorlistschema as author>     
858
859		                "@type" : "Person", 
860		    	<#list author as cur_author_key, cur_author_value> 
861		    			<#if cur_author_key=="url" && cur_author_value?has_content>"${cur_author_key}"  : "${cur_author_value}",</#if>		        		 
862		        		<#if cur_author_key=="jobTitle" && cur_author_value?has_content>"${cur_author_key}"  : "${cur_author_value}",</#if> 
863		        		<#if cur_author_key=="name" && cur_author_value?has_content>"${cur_author_key}"  : "${cur_author_value}"</#if> 
864		        		 
865		    	</#list> 
866		    	        }<#if (author?index != (authorlistschema?size)-1)>,</#if> 
867		    </#list>	 
868		  </#if> 
869		  ], 
870		  "publisher": { 
871		        "@type": "Organization", 
872		        "@id": "https://www.kearney.com#organization" 
873
874
875	</script> 
876<#elseif Slug.getData()?lower_case == "question and answer" > 
877	<script id ="answer-structured-data" type="application/ld+json"> 
878	 {	 		 	 
879	      "@context": "https://schema.org", 
880	      "@type": "FAQPage", 
881	      "mainEntity": [{ 
882	          "@type": "Question", 
883	          "name": "${ArticleTitle.getData()?json_string}", 
884	          "acceptedAnswer": { 
885	            "@type": "Answer", 
886	             <#if answer?has_content>"text" : "${answer?json_string}",</#if>             
887	            "author" : [ 
888							  <#if (authorlistschema?size > 0)> 
889							    <#list authorlistschema as author>     
890
891							                "@type" : "Person", 
892							    	<#list author as cur_author_key, cur_author_value>						 
893							    			<#if cur_author_key=="url" && cur_author_value?has_content>"${cur_author_key}"  : "${cur_author_value}",</#if>	        		 
894							        		<#if cur_author_key=="jobTitle" && cur_author_value?has_content>"${cur_author_key}"  : "${cur_author_value}",</#if> 
895							        		<#if cur_author_key=="name" && cur_author_value?has_content>"${cur_author_key}"  : "${cur_author_value}"</#if> 
896							        		 
897							    	</#list> 
898							    	        }<#if (author?index != (authorlistschema?size)-1)>,</#if> 
899							    </#list>	 
900							  </#if> 
901
902
903	        }] 
904
905	 </script> 
906 </#if> 
907 </#compress>