683 assetOrderMap[assetOrderArr[order-1]] = order; 

684 } 

685 

686 var getAssetOrder = function(uuid) { 

687 var order = assetOrderMap[uuid]; 

688 if(!order) { 

689 order = Object.keys(assetOrderMap).length + 1; 

690 assetOrderMap[uuid] = order; 

691 } 

692 

693 return order; 

694 }; 

695 <#assign authorlistschema = [] /> 

696 <#assign authorListForPdf = [] /> 

697 

698 <#if Authors?? && Authors.getSiblings()?has_content> 

699  

700 var bioC =0; 

701 <#list Authors.getSiblings() as cur_Authors> 

702  

703 <#if cur_Authors.getData() != “” > 

704 <#assign cur_webContent_map = jsonFactoryUtil.createJSONObject(cur_Authors.getData())> 

705 <#assign cur_webContent_classPK = cur_webContent_map.getString(“classPK”)> 

706 <#if cur_webContent_classPK??> 

707 <#if JournalArticleLocalService.fetchLatestArticle(cur_webContent_classPK?number)?? && !JournalArticleLocalService.fetchLatestArticle(cur_webContent_classPK?number).isExpired()> 

708 <#assign articleK = JournalArticleLocalService.fetchLatestArticle(cur_webContent_classPK?number)> 

709 <#assign articleKAssetEntry = AssetEntryLocalService.getEntry(“com.liferay.journal.model.JournalArticle”,articleK.getResourcePrimKey()) /> 

710  

711 <#if articleKAssetEntry?? && articleKAssetEntry.getAssetRenderer()??> 

712 <#assign xml = saxReaderUtil.read(articleKAssetEntry.getAssetRenderer().getArticle().getContentByLocale(themeDisplay.getLocale())) /> 

713  

714  

715  

716 <#assign xml_fullName = xml.valueOf(“//dynamic-element[@name=’FullName’]/dynamic-content/text()”) /> 

717 <#assign xml_title = xml.valueOf(“//dynamic-element[@name=’Title’]/dynamic-content/text()”) /> 

718 <#assign xml_headshotImage = TemplateCustomService.getDocumentFileDetails(xml,”CutoutHeadshot”,themeDisplay)/> 

719  

720 <#– Split on ‘*****’ to separate the ID+filename part and the URL –> 

721 <#assign headshotxmlImageDetailParts = xml_headshotImage?split(“*****”)!””> 

722  

723 <#– Extract the left and right parts –> 

724 <#assign headshotxmlLeftPart = headshotxmlImageDetailParts[0]!””> 

725 <#assign xml_headshotImage = headshotxmlImageDetailParts[1]!””> 

726  

727 <#– From the left part, split on ‘+++++’ to get the ID –> 

728 <#assign headshotxmlImageFileEntryId = headshotxmlLeftPart?split(“+++++”)[0]!””> 

729 <#assign headshotxmlImageFileName = headshotxmlLeftPart?split(“+++++”)[1]!””> 

730  

731 <#if xml_headshotImage?contains(“&download=”)> 

732 <#assign xml_headshotImage = xml_headshotImage?keep_before(“&download=”)> 

733 #if>  

734  

735  

736 var bio1 = {}; 

737 bio1.structureKey=(‘${articleK.getDDMStructure().getName(“en_US”)}’); 

738 bio1.weight= ++bioC; 

739 bio1.fullName = ‘${(htmlUtil.unescape(xml_fullName))?js_string}’; 

740 bio1.headshot = ‘${xml_headshotImage?js_string}’; 

741 bio1.imageFileEntryId = ‘${headshotxmlImageFileEntryId?js_string}’; 

742 bio1.imageFileName = ‘${headshotxmlImageFileName?js_string}’; 

743 bio1.imageSaturationFilter = ‘${imageSaturationFilter?c}’, 

744 bio1.title = ‘${xml_title}’; 

745 <#if (articleGroup.getLiveGroupId() != 0 ) >  

746 <#assign articleK = JournalArticleLocalService.getArticleByUrlTitle(assetLibGroupId, articleK.getUrlTitle()) />  

747 #if>  

748 <#assign viewURL = ” /> 

749  

750 <#if articleK.getDDMStructure().getName(“en_US”) == “Bio Page”> 

751 <#assign viewURL = TemplateCustomService.getArticleViewURL(articleK.getArticleId(),assetLibGroup,articleK.getGroupId(),themeDisplay,guestGroup.getGroupId())/> 

752 <#if !(viewURL?has_content)> 

753 <#assign viewURL = themeDisplay.getPortalURL() + “/about/people/bio/” + xml_fullName?lower_case?replace(” “, “-“)/> 

754 #if> 

755 #if> 

756  

757 bio1.bioURL = ‘${viewURL}’;  

758 bios.push(bio1); 

759 <#assign authorListForPdf = [xml_fullName + “::::::::” + xml_title + “++++++++” + viewURL + “;;;;;;;;” + headshotxmlImageFileEntryId] + authorListForPdf /> 

760 <#assign viewURLschema = ”/> 

761 <#if viewURL?has_content> 

762 <#assign viewURLschema = viewURL /> 

763 #if> 

764 <#assign authordataschema = {“url”:viewURLschema, “jobTitle”:xml_title, “name”:xml_fullName} /> 

765 <#assign authorlistschema = authorlistschema + [authordataschema] /> 

766 #if>  

767 #if>  

768 #if> 

769 #if> 

770  

771 #list> 

772  

773 #if> 

774  

775 <#assign oldwaytogetauthourforschema = false> 

776 <#if authorlistschema?size == 0> 

777 <#assign oldwaytogetauthourforschema = true> 

778 #if>  

779  

780 if (bios.length == 0){ 

781 <#assign authorCounter = authorListForPdf?size /> 

782 <#if AssetLinks?has_content> 

783 

784 <#list AssetLinks as assetLink> 

785 <#assign linkedAssetEntry = AssetEntryLocalService.getAssetEntry(assetLink.getEntryId2())> 

786 <#assign linkedJournalArticle = JournalArticleLocalService.getLatestArticle(linkedAssetEntry.getClassPK())> 

787 <#assign xml = saxReaderUtil.read(linkedAssetEntry.getAssetRenderer().getArticle().getContentByLocale(themeDisplay.getLocale())) /> 

788 <#assign structureKey = linkedJournalArticle.getDDMStructure().getName(“en_US”) /> 

789  

790 var bio = {}; 

791  

792 <#assign xml_headshotDetails = TemplateCustomService.getDocumentFileDetails(xml,”CutoutHeadshot”,themeDisplay)/> 

793  

794 <#– Split on ‘*****’ to separate the ID+filename part and the URL –> 

795 <#assign headshotImageDetailParts = xml_headshotDetails?split(“*****”)!””> 

796  

797 <#– Extract the left and right parts –> 

798 <#assign headshotLeftPart = headshotImageDetailParts[0]!””> 

799 <#assign xml_headshot = headshotImageDetailParts[1]!””> 

800  

801 <#– From the left part, split on ‘+++++’ to get the ID –> 

802 <#assign headshotImageFileEntryId = headshotLeftPart?split(“+++++”)[0]!””> 

803 <#assign headshotImageFileName = headshotLeftPart?split(“+++++”)[1]!””> 

804  

805  

806 <#if xml_headshot?contains(“&download=”)> 

807 <#assign xml_headshot = xml_headshot?keep_before(“&download=”)> 

808 #if>  

809 <#if structureKey == “Bio Page” || structureKey == “Micro Bio” > 

810 <#assign xml_fullName = xml.valueOf(“//dynamic-element[@name=’FullName’]/dynamic-content/text()”) /> 

811 <#assign xml_title = xml.valueOf(“//dynamic-element[@name=’Title’]/dynamic-content/text()”) /> 

812 bio.structureKey=(‘${structureKey}’).trim(); 

813 bio.weight = getAssetOrder(“${linkedJournalArticle.getArticleId()}”);  

814 bio.fullName = “${(htmlUtil.unescape(xml_fullName))?js_string}”; 

815 bio.position = “${xml.valueOf(“//dynamic-element[@name=’Position’]/dynamic-content/text()”)?js_string}”; 

816 bio.title = “${xml_title?js_string}”; 

817 bio.headshot = “${xml_headshot?js_string}”; 

818 bio.imageFileEntryId = “${headshotImageFileEntryId?js_string}”; 

819 bio.imageFileName = “${headshotImageFileName?js_string}”; 

820 bio.imageSaturationFilter =’${imageSaturationFilter?c}’, 

821 bio.description = “${xml.valueOf(“//dynamic-element[@name=’Description’]/dynamic-content/text()”)?js_string}”; 

822 bio.linkedInURL = “${xml.valueOf(“//dynamic-element[@name=’LinkedInURL’]/dynamic-content/text()”)?js_string}”; 

823  

824 <#assign viewURL = ” /> 

825 <#if linkedJournalArticle.getDDMStructure().getName(“en_US”) == “Bio Page”> 

826 <#assign viewURL = themeDisplay.getPortalURL() + “/about/people/bio/” + xml_fullName?lower_case?replace(” “, “-“)/> 

827 #if> 

828  

829 bio.bioURL = ‘${viewURL}’;  

830 bios.push(bio); 

831 

832 <#if authorCounter == 0> 

833 <#assign authorListForPdf = [xml_fullName + “::::::::” + xml_title + “++++++++” + viewURL + “;;;;;;;;” + headshotImageFileEntryId] + authorListForPdf /> 

834 #if> 

835  

836 <#assign viewURLschema = ”/> 

837 <#if viewURL?has_content> 

838 <#assign viewURLschema = viewURL /> 

839 #if> 

840  

841 <#if oldwaytogetauthourforschema> 

842 <#assign authordataschema = {“url”:viewURLschema, “jobTitle”:xml_title, “name”:xml_fullName} /> 

843 <#assign authorlistschema = authorlistschema + [authordataschema] /> 

844 #if>  

845 #if> 

846 #list> 

847 

848 bios.sort(function(bio1, bio2){ 

849 return bio1.weight – bio2.weight; 

850 }); 

851 #if> 

852 

853 } 

854 <#assign assetCategories = AssetCategoryLocalService.getCategories(CurrentAssetEntry.getClassNameId(), CurrentAssetEntry.getClassPK())> 

855 

856 var articleCategories = []; 

857 

858 <#list assetCategories as category> 

859 <#assign categoryVocabulary = AssetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId())> 

860 <#assign categoryUrl = “#”> 

861 

862 <#list AssetCategoryPropertyLocalService.getCategoryProperties(category.categoryId) as categoryProperty> 

863 

864 <#if categoryProperty.key == “url”> 

865 <#assign categoryUrl = categoryProperty.value> 

866 #if> 

867 #list> 

868 

869 articleCategories.push({ 

870 id: “${category.categoryId}”, 

871 name: “${category.name}”, 

872 url: “${categoryUrl}”, 

873 vocabularyName: “${categoryVocabulary.getName()?js_string}”, 

874 }); 

875 #list> 

876 

877 articleMetadata.categories = articleCategories; 

878 <#if LayoutSetService.getLayoutSet(articleGroup.getGroupId(), false)?? 

879 && LayoutSetService.getLayoutSet(articleGroup.getGroupId(), false).getThemeSetting(“isMicroSite”, “regular”)?? > 

880 <#assign isMicroSite = (LayoutSetService.getLayoutSet(articleGroup.getGroupId(), false).getThemeSetting(“isMicroSite”, “regular”) == “true”)> 

881 <#else> 

882 <#assign isMicroSite = false> 

883 #if> 

884  

885 <#– ATK-1384 — 240212 is groupid for Microsite –> 

886 <#assign siteName = “Kearney”> 

887 <#if GroupLocalService.getGroup(themeDisplay.getScopeGroupId()).getParentGroupId() == 240212> 

888 <#assign siteName = GroupLocalService.getGroup(themeDisplay.getScopeGroupId()).getName(“en_US”)?cap_first /> 

889 #if>  

890 

891 articleMetadata.isMicroSite = ${isMicroSite?c}; 

892 articleMetadata.groupName = “${articleGroup.getName(“en_US”)?js_string}”; 

893 articleMetadata.siteName = “${siteName?js_string}”; 

894 articleMetadata.groupFriendlyUrl = “${articleGroup.getFriendlyURL()?js_string}”; 

895 

896 <#if ReadMoreURL??> 

897 articleMetadata.readMoreURL = “${ReadMoreURL.getData()?js_string}”; 

898 <#else> 

899 articleMetadata.readMoreURL = “”; 

900 #if> 

901 

902 <#if ReadMoreTextOverride??> 

903 articleMetadata.readMoreTextOverride = “${(htmlUtil.unescape(ReadMoreTextOverride.getData()))?js_string}”; 

904 <#else> 

905 articleMetadata.readMoreTextOverride = “”; 

906 #if> 

907 

908 <#if ContributorsTitleOverride??> 

909 articleMetadata.contributorsTitleOverride = “${(htmlUtil.unescape(ContributorsTitleOverride.getData()))?js_string}”; 

910 <#else> 

911 articleMetadata.contributorsTitleOverride = “”; 

912 #if> 

913 

914 <#if ReadMoreOverlay??> 

915 articleMetadata.readMoreOverlay = ${getterUtil.getBoolean(ReadMoreOverlay.getData())?c} 

916 <#else> 

917 articleMetadata.readMoreOverlay = false; 

918 #if> 

919  

920 var sidebarContents = []; 

921 <#assign enableSidebar = false> 

922 <#if EnableSidebar??> 

923 <#assign enableSidebar = getterUtil.getBoolean(EnableSidebar.getData())> 

924 #if> 

925 <#– Check if Sidebar is enabled or not –> 

926 <#if enableSidebar == true> 

927  

928 <#assign listingOfArticles = false> 

929 <#assign singleAssetWithImage = false> 

930 <#assign richTextSection = false> 

931 <#assign listView = false> 

932 <#if EnableSidebar.ListingOfArticles??>  

933 <#assign listingOfArticles = getterUtil.getBoolean(EnableSidebar.ListingOfArticles.getData())> 

934 #if> 

935 <#if EnableSidebar.SingleAssetWithImage??> 

936 <#assign singleAssetWithImage = getterUtil.getBoolean(EnableSidebar.SingleAssetWithImage.getData())> 

937 #if> 

938 <#if EnableSidebar.RichTextSection??> 

939 <#assign richTextSection = getterUtil.getBoolean(EnableSidebar.RichTextSection.getData())> 

940 #if> 

941 <#if EnableSidebar.ListView??> 

942 <#assign listView = getterUtil.getBoolean(EnableSidebar.ListView.getData())>  

943 #if> 

944  

945 <#– Web content with Link Structure — ATK-1208 –> 

946 <#if PostArticleSlideShareKeyFieldSet.PostArticleSlideShareKeyFieldSetFieldSet.PostArticleSlideshareContent?has_content> 

947 <#assign linkAssetArticle = ArticleTemplateCustomService.getManualArticle(PostArticleSlideShareKeyFieldSet.PostArticleSlideShareKeyFieldSetFieldSet.PostArticleSlideshareContent.getData())!”null” /> 

948 <#if !linkAssetArticle?matches(“null”)>  

949 <#assign jArt = JournalArticleLocalService.getLatestArticle(linkAssetArticle.getClassPK())> 

950 <#assign document = saxReaderUtil.read(jArt.getContentByLocale(themeDisplay.getLocale()))> 

951 <#assign structureName = jArt.getDDMStructure().getName(“en_US”)> 

952 <#if structureName?matches(“Link”)> 

953 var articleSidebarRichText = <@entryNode document=document field=”ArticleSidebarRichText”/>; 

954 var linkWebContentData = { 

955 articleSidebarRichText: articleSidebarRichText 

956 } 

957 sidebarContents.push({ 

958 linkWebContentData:linkWebContentData, 

959 componentType:”linkWebContent” 

960 }); 

961 #if> 

962 #if> 

963 #if> 

964  

965 <#– If Asset publisher listing of articles is enabled –> 

966 <#if listingOfArticles == true> 

967  

968 <#assign listOfArticlesTitles = “Related”> 

969 <#if EnableSidebarFieldSet.EnableSidebarFieldSetFieldSet.ListingOfArticlesFieldSet.ListingOfArticlesFieldSetFieldSet.getSiblings()?has_content> 

970 <#list EnableSidebarFieldSet.EnableSidebarFieldSetFieldSet.ListingOfArticlesFieldSet.ListingOfArticlesFieldSetFieldSet.getSiblings() as assetArticleListEntry> 

971 <#if assetArticleListEntry.ListingOfArticlesTitle.getData()?has_content> 

972 <#assign listOfArticlesTitles = htmlUtil.unescape(assetArticleListEntry.ListingOfArticlesTitle.getData())> 

973 #if>  

974 <#assign manualArticlesEntries = {}>  

975 <#if assetArticleListEntry.SelectSidebarArticles??> 

976 <#assign manualArticlesEntries = ArticleTemplateCustomService.getManualArticleList(assetArticleListEntry.SelectSidebarArticles.getSiblings())>  

977 #if> 

978 var manualArticlesEntry = []; 

979 <#if manualArticlesEntries?size > 0 > 

980 <#list manualArticlesEntries as curEntry> 

981 <#assign jArt = JournalArticleLocalService.getLatestArticle(curEntry.getClassPK())> 

982 <#assign viewURL = TemplateCustomService.getSidebarArticleViewURL(themeDisplay,jArt,assetLibGroup)/> 

983 var articleEntry = {“articleTitle”: “${TemplateCustomService.getSidebarArticleTitle(themeDisplay,jArt,assetLibGroup)}”,”articleURL”:”${viewURL}”}; 

984 manualArticlesEntry.push(articleEntry);  

985 #list> 

986 <#else> 

987 <#assign noOfFeatureArticle = “3”> 

988 <#if assetArticleListEntry.NoOfArticlesDisplayed.getData() != “0”> 

989 <#assign noOfFeatureArticle = assetArticleListEntry.NoOfArticlesDisplayed.getData()>  

990 #if> 

991 <#assign manualArticlesEntries = ArticleTemplateCustomService.getRelatedArticles(CurrentAssetEntry.getEntryId(), CurrentAssetEntry.getClassTypeId(), noOfFeatureArticle, “Any”)> 

992 <#list manualArticlesEntries as curEntry> 

993 <#assign jArt = JournalArticleLocalService.getLatestArticle(curEntry.getClassPK())> 

994 <#assign viewURL = TemplateCustomService.getSidebarArticleViewURL(themeDisplay,jArt,assetLibGroup)/> 

995 var articleEntry = {“articleTitle”: “${TemplateCustomService.getSidebarArticleTitle(themeDisplay,jArt,assetLibGroup)}”,”articleURL”:”${viewURL}”}; 

996 manualArticlesEntry.push(articleEntry);  

997 #list>  

998 #if> 

999 sidebarContents.push({ 

1000 listingOfArticlesTitle:”${listOfArticlesTitles}”, 

1001 manualArticles:manualArticlesEntry, 

1002 componentType:”listingOfArticles” 

1003 }); 

1004 #list> 

1005 #if> 

1006  

1007 #if> 

1008 <#– Single Asset Image article –> 

1009 <#if singleAssetWithImage == true> 

1010 <#if EnableSidebarFieldSet.EnableSidebarFieldSetFieldSet.SingleAssetWithImageFieldSet.SingleAssetWithImageArticleFieldSet.getSiblings()?has_content> 

1011 <#list EnableSidebarFieldSet.EnableSidebarFieldSetFieldSet.SingleAssetWithImageFieldSet.SingleAssetWithImageArticleFieldSet.getSiblings() as singleAssetEntry> 

1012  

1013 <#assign learnMoreText = “Learn more”> 

1014 <#assign enableTNSImage = true>  

1015 <#assign enableSlug = true> 

1016 

1017 <#if singleAssetEntry.SingleAssetWithImageArticleFieldSetFieldSet.LearnMoreButtonText.getData()??> 

1018 <#assign learnMoreText = htmlUtil.unescape(singleAssetEntry.SingleAssetWithImageArticleFieldSetFieldSet.LearnMoreButtonText.getData())/> 

1019 #if> 

1020 

1021 <#if singleAssetEntry.SingleAssetWithImageArticleFieldSetFieldSet.EnableTNSImage??> 

1022 <#assign enableTNSImage = getterUtil.getBoolean(singleAssetEntry.SingleAssetWithImageArticleFieldSetFieldSet.EnableTNSImage.getData())/> 

1023 #if>  

1024 

1025 <#if singleAssetEntry.SingleAssetWithImageArticleFieldSetFieldSet.EnableSlug??> 

1026 <#assign enableSlug = getterUtil.getBoolean(singleAssetEntry.SingleAssetWithImageArticleFieldSetFieldSet.EnableSlug.getData())>  

1027 #if> 

1028 

1029 <#assign singleAssetArticleData = jsonFactoryUtil.createJSONObject(singleAssetEntry.SingleAssetWithImageArticle.getData())/> 

1030  

1031 <#if singleAssetArticleData?has_content>  

1032 <#assign singleAssetArticle = ArticleTemplateCustomService.getManualArticle(singleAssetEntry.SingleAssetWithImageArticle.getData())> 

1033 <#assign jArt = JournalArticleLocalService.getLatestArticle(singleAssetArticle.getClassPK())> 

1034 <#assign document = saxReaderUtil.read(jArt.getContentByLocale(themeDisplay.getLocale()))> 

1035 <#assign structureName = jArt.getDDMStructure().getName(“en_US”)> 

1036  

1037 var componentType = “FEATURED_ARTICLE”; 

1038 var title = <@entryNode document=document field=”ArticleTitle”/>;  

1039 var subtitle = <@entryNode document=document field=”Subtitle”/>;  

1040 var description = <@entryNode document=document field=”Description”/>; 

1041 if (description == “”) { 

1042 description = <@entryNode document=document field=”Intro”/>; 

1043 } 

1044 var slug = <@entryNode document=document field=”Slug”/>;  

1045 var linkTargetOverride = <@entryNode document=document field=”LinkTargetOverride”/>;  

1046  

1047 if(linkTargetOverride == “” || linkTargetOverride == null) { 

1048 linkTargetOverride = <@entryNode document=document field=”LinkURL”/>;  

1049 } 

1050 <#– ATK-1357 Changes Start –> 

1051 var videoUrl = “”; 

1052 <#if structureName?matches(‘Video’)>  

1053 videoUrl = <@entryNode document=document field=”VideoURL”/>; 

1054 #if> 

1055 <#– ATK-1357 Changes End –>  

1056 

1057 <#assign articleGroup = GroupLocalService.getGroup(jArt.getGroupId())> 

1058 

1059 <#if LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false)??&& LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false).getThemeSetting(“isMicroSite”, “regular”)??> 

1060 <#assign isMicroSite = (LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false).getThemeSetting(“isMicroSite”, “regular”) == “true”)> 

1061 <#else> 

1062 <#assign isMicroSite = false> 

1063 #if> 

1064 

1065 var imageFileEntryId = 0; 

1066 var imageFileName = “”; 

1067 var image = ‘${TemplateCustomService.getDocumentFileDetails(document,”ThumbnailSquare”,themeDisplay)}’; 

1068 if (null == image || “” == image) { 

1069 image = ‘${TemplateCustomService.getDocumentFileDetails(document,”Thumbnail”,themeDisplay)}’; 

1070 } 

1071 if (null == image) { 

1072 image = “”; 

1073 } 

1074  

1075 if ((image) || image != “”) {  

1076 var [imageFileEntryId, restString] = image.split(‘+++++’); 

1077 var [imageFileName, image] = restString.split(‘*****’); 

1078 } 

1079 

1080 var singleAssetComponent = { 

1081 slug: slug, 

1082 title: title, 

1083 subtitle: subtitle, 

1084 description: description, 

1085 structureName: ‘${structureName}’, 

1086 image: image.trim(), 

1087 imageFileEntryId: imageFileEntryId, 

1088 imageFileName: imageFileName, 

1089 imageSaturationFilter:’${imageSaturationFilter?c}’, 

1090 groupFriendlyUrl: ‘${articleGroup.getFriendlyURL()}’, 

1091 isMicrosite: ${isMicroSite?c}, 

1092 linkTargetOverride: linkTargetOverride, 

1093 videoUrl: videoUrl 

1094 } 

1095  

1096 sidebarContents.push({ 

1097 singleAssetData: singleAssetComponent, 

1098 componentType: “singleAsset”, 

1099 learnMoreTextValue: ‘${learnMoreText}’, 

1100 enableSlugValue: ${enableSlug?c}, 

1101 enableTNSImageValue: ${enableTNSImage?c} 

1102 }); 

1103 #if> 

1104 #list> 

1105 #if> 

1106 

1107 #if> 

1108 <#– Rich Text Section –> 

1109 <#if richTextSection == true> 

1110 var richTextSectionData = []; 

1111 <#if EnableSidebar.RichTextSection.RichTextSectionContent.getSiblings()?has_content> 

1112 <#list EnableSidebar.RichTextSection.RichTextSectionContent.getSiblings() as richTextData> 

1113 <#if (richTextData.getData())??> 

1114 <#assign richTextSection = richTextData.getData()> 

1115 richTextSectionData.push({ 

1116 richTextSectionContent: ‘${richTextSection?js_string}’ 

1117 }); 

1118 #if> 

1119 #list> 

1120 #if> 

1121  

1122 sidebarContents.push({ 

1123 richTextContentData : richTextSectionData, 

1124 componentType:”richTextContent” 

1125 }); 

1126 #if> 

1127 <#– List View –> 

1128 <#if listView == true> 

1129 <#if EnableSidebarFieldSet.EnableSidebarFieldSetFieldSet.ListViewFieldSet.ListViewFieldSetFieldSet.getSiblings()?has_content> 

1130 <#list EnableSidebarFieldSet.EnableSidebarFieldSetFieldSet.ListViewFieldSet.ListViewFieldSetFieldSet.getSiblings() as listViewEntry> 

1131 

1132 var listViewComponentData = []; 

1133 <#assign listViewTitle = “Related”>  

1134 <#assign displayListViewTitle = false> 

1135  

1136 <#if listViewEntry.ListViewTitleFieldSet.ListViewTitle.getData()??> 

1137 <#assign listViewTitle = htmlUtil.unescape(listViewEntry.ListViewTitleFieldSet.ListViewTitle.getData())> 

1138 #if> 

1139  

1140 <#if listViewEntry.ListViewTitleFieldSet.ListViewTitleFieldSetFieldSet.DisplayListViewTitle.getData()??> 

1141 <#assign displayListViewTitle = getterUtil.getBoolean(listViewEntry.ListViewTitleFieldSet.ListViewTitleFieldSetFieldSet.DisplayListViewTitle.getData())>  

1142 #if> 

1143  

1144 <#if listViewEntry.ListViewTextFieldSet.getSiblings()?has_content> 

1145 <#list listViewEntry.ListViewTextFieldSet.getSiblings() as listViewData> 

1146 <#assign listView = htmlUtil.unescape(listViewData.ListViewText.getData())> 

1147 <#assign listlink = listViewData.ListViewTextFieldSetFieldSet.ListViewLink.getData()> 

1148 listViewComponentData.push({ 

1149 listViewTitle: ‘${listView}’, 

1150 listViewLink: ‘${listlink}’, 

1151 }); 

1152 #list> 

1153 #if> 

1154  

1155 sidebarContents.push({ 

1156 listViewData: listViewComponentData, 

1157 componentType: “listView”, 

1158 listViewTitleValue: ‘${listViewTitle}’, 

1159 displayListViewTitleValue: ${displayListViewTitle?c} 

1160 }); 

1161 #list> 

1162 #if> 

1163 

1164 #if> 

1165  

1166 #if> 

1167  

1168 <#– ATK – 902 Changes Start –> 

1169 ATK.isArticlePage = ‘false’; 

1170 <#if LandingArticle == false > 

1171 <#if themeDisplay.getURLCurrent()?contains(“/article/”) || themeDisplay.getURLCurrent()?contains(“/-/”) || (themeDisplay.getURLCurrent()?contains(“/alumni/alumni-profiles/”) && !themeDisplay.getURLCurrent()?ends_with(“/alumni/alumni-profiles/”)) > 

1172 ATK.isArticlePage = ‘true’; 

1173 #if> 

1174 #if>  

1175 <#– ATK – 902 Changes Over –> 

1176 

1177 <#if PDF?? && PDF.getData() != “”> 

1178 articleMetadata.pdf = “${PDF.getData()?js_string}” 

1179 <#else> 

1180 <#if !GroupLocalService.getGroup(themeDisplay.getScopeGroupId()).getName(“en_US”)?matches(“Japan”) && !GroupLocalService.getGroup(themeDisplay.getScopeGroupId()).getName(“en_US”)?matches(“China”)> 

1181 <#assign pdfURL = DynamicPDFGenerationCustomService.getPdfUrl(CurrentJournalArticle, assetLibGroup, “Article-Pdf”, themeDisplay, authorListForPdf, isMicroSite, LandingArticle, “pdf-boilerplate-code”, externalHeroBannerImageURL, hasExternalHeroBanner, externalHeroBannerTitle, externalHeroBannerSubTitle) /> 

1182 articleMetadata.pdf = “${pdfURL?js_string}”; 

1183 #if> 

1184 #if> 

1185  

1186 ATK.React.App.Article(‘articleDiv’, articleMetadata, articleContents, bios, sidebarContents); 

1187 

1188 // Run embedded scripts after article renders. 

1189 for (var i in articleContents) { 

1190 

1191 var re = //gi; ]]>

1192 var thisExtractedScript = [”, ”]; 

1193 

1194 while (null != (thisExtractedScript = re.exec(articleContents[i].content))) { 

1195 window.eval(thisExtractedScript[1]); 

1196 } 

1197 } 

1198 

1199 

1200 

1201 

1204 

1205 

1206 

1207 

1208

1209<#assign enableRelatedInsights = false> 

1210 

1211<#if EnableRelatedInsights??> 

1212 <#assign enableRelatedInsights = getterUtil.getBoolean(EnableRelatedInsights.getData())> 

1213#if> 

1214<#if enableRelatedInsights == true> 

1215<#assign multiArtBehavior = “Two Wide”> 

1216<#assign gridTitle = “Also of interest”> 

1217<#assign noOfFeatureArticle = “2”> 

1218<#assign featureDisplayType = “Image Left”> 

1219 

1220<#assign fullWidthDisplay = “false”> 

1221<#assign greyBackground = “false”> 

1222<#assign extraSpacer = “None”> 

1223<#assign seeAllLink = “”> 

1224<#assign seeAllLinkText = “”> 

1225<#assign greyBackground = “false”> 

1226<#assign extraSpacer = “None”> 

1227<#assign autoplay = “false”> 

1228<#assign featureDisplayButtonType = “Visible”> 

1229<#assign featureDisplayButtonText = “”> 

1230 

1231<#if GridTitle??> 

1232 <#assign gridTitle = htmlUtil.unescape(GridTitle.getData())> 

1233#if> 

1234<#if gridTitle?has_content> 

1235 <#– ATK-712: Code Start –> 

1236 <#if gridTitle?matches(“Related insights”) || gridTitle?matches(“Related Insights”)> 

1237 <#assign gridTitle = “Also of interest”> 

1238 #if> 

1239 <#– ATK-712: Code End –> 

1240<#else> 

1241 <#assign gridTitle = “Also of interest”> 

1242#if> 

1243<#if MultipleArticleBehavior??> 

1244 <#assign multiArtBehavior = MultipleArticleBehavior.getData()> 

1245#if> 

1246<#if multiArtBehavior?has_content> 

1247<#else> 

1248 <#assign multiArtBehavior = “Two Wide”> 

1249#if> 

1250<#if NoOfFeatureArticles??> 

1251 <#assign noOfFeatureArticle = NoOfFeatureArticles.getData()> 

1252#if> 

1253<#if noOfFeatureArticle?has_content> 

1254<#else> 

1255 <#assign noOfFeatureArticle = “2”> 

1256#if> 

1257 

1258<#assign featureDisplayType = preferences.getValue(“featureDisTypeRelatedInsights”, “Image Left”)?js_string> 

1259 

1260<#assign jaEntries = {}>  

1261<#if RelatedInsightsArticles??> 

1262 <#assign jaEntries = ArticleTemplateCustomService.getManualArticleList(RelatedInsightsArticles.getSiblings())>  

1263#if> 

1264 

1265<#if jaEntries?size == 0 > 

1266 <#attempt> 

1267 <#assign jaEntries = ArticleTemplateCustomService.getRelatedArticles(CurrentAssetEntry.getEntryId(), CurrentAssetEntry.getClassTypeId(), noOfFeatureArticle, “Any”)> 

1268 <#recover> 

1269 <#assign jaEntries = {}> 

1270 #attempt> 

1271#if> 

1272 

1273<#if jaEntries?size == 0 > 

1274 <#assign gridTitle = ” “> 

1275<#else> 

1276 $(‘#hrfeatureArticle’).css(‘display’,’block’); 

1277#if> 

1278 

1279var entries = []; 

1280 <#if jaEntries?size > 0 > 

1281 <#list jaEntries as curEntry> 

1282 

1283 <#assign jArt = JournalArticleLocalService.getLatestArticle(curEntry.getClassPK())> 

1284 <#assign document = saxReaderUtil.read(jArt.getContentByLocale(themeDisplay.getLocale()))> 

1285 

1286 <#assign structureName = jArt.getDDMStructure().getName(“en_US”)> 

1287 

1288 var componentType = “FEATURED_ARTICLE”; 

1289 

1290 var title = <@entryNode document=document field=”ArticleTitle”/>; 

1291 

1292 var subtitle = <@entryNode document=document field=”Subtitle”/>; 

1293 

1294 var description = <@entryNode document=document field=”Description”/>; 

1295 if (description == “”){ 

1296 description = <@entryNode document=document field=”Intro”/>; 

1297 } 

1298 

1299 var slug = <@entryNode document=document field=”Slug”/>; 

1300 

1301 <#assign articleGroup = GroupLocalService.getGroup(jArt.getGroupId())> 

1302 

1303 <#if LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false)?? 

1304 && LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false).getThemeSetting(“isMicroSite”, “regular”)?? > 

1305 <#assign isMicroSite = (LayoutSetService.getLayoutSet(themeDisplay.getScopeGroupId(), false).getThemeSetting(“isMicroSite”, “regular”) == “true”)> 

1306 <#else> 

1307 <#assign isMicroSite = false> 

1308 #if> 

1309 

1310 var imageFileEntryId = 0; 

1311 var imageFileName = “”; 

1312 var image = ‘${TemplateCustomService.getDocumentFileDetails(document,”ThumbnailSquare”,themeDisplay)}’;  

1313 if (null == image || “” == image || ${(fullWidthDisplay == “true”)?c}) { 

1314 image = ‘${TemplateCustomService.getDocumentFileDetails(document,”Thumbnail”,themeDisplay)}’; 

1315 } 

1316 if (null == image) { 

1317 image = “”; 

1318 } 

1319  

1320 if ((image) || image != “”) {  

1321 var [imageFileEntryId, restString] = image.split(‘+++++’); 

1322 var [imageFileName, image] = restString.split(‘*****’); 

1323 } 

1324 

1325 var componentData = { 

1326 locale: “${locale}”, 

1327 structureName: “${structureName}”, 

1328 displayType: “${featureDisplayType}”, 

1329 slug: slug, 

1330 title: title, 

1331 subtitle: subtitle, 

1332 description: description, 

1333 image: image.trim(), 

1334 imageFileEntryId: imageFileEntryId, 

1335 imageFileName: imageFileName, 

1336 imageSaturationFilter:’${imageSaturationFilter?c}’, 

1337 groupFriendlyUrl: ‘${articleGroup.getFriendlyURL()}’, 

1338 isMicrosite: ${isMicroSite?c}, 

1339 multiArtBehavior: ‘${multiArtBehavior}’, 

1340 featureDisplayButtonText: ‘${featureDisplayButtonText}’, 

1341 featureDisplayButtonType: ‘${featureDisplayButtonType}’, 

1342 componentType: componentType 

1343 }; 

1344 <#if structureName == “Article”> 

1345 

1346 var linkTargetOverride = <@entryNode document=document field=”LinkTargetOverride”/>; 

1347 

1348 if (linkTargetOverride !== “”){ 

1349 componentData.link = linkTargetOverride; 

1350 } else {  

1351 <#assign assetCategories = AssetCategoryLocalService.getCategories(curEntry.getClassNameId(), curEntry.getClassPK())> 

1352 

1353 var articleCategories = []; 

1354 

1355 <#list assetCategories as category> 

1356 <#assign categoryVocabulary = AssetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId())> 

1357 <#assign categoryUrl = “#”> 

1358 

1359 <#list AssetCategoryPropertyLocalService.getCategoryProperties(category.categoryId) as categoryProperty> 

1360 

1361 <#if categoryProperty.key == “url”> 

1362 <#assign categoryUrl = categoryProperty.value> 

1363 #if> 

1364 #list> 

1365  

1366 articleCategories.push({ 

1367 id: “${category.categoryId}”, 

1368 name: “${category.name}”, 

1369 url: “${categoryUrl}”, 

1370 vocabularyName: “${categoryVocabulary.getTitle(locale)}”, 

1371 }); 

1372  

1373 #list> 

1374 

1375 

1376 componentData.categories = articleCategories; 

1377 componentData.urlTitle = “${jArt.getUrlTitle()?js_string}”; 

1378 } 

1379 

1380 var byline = <@entryNode document=document field=”Byline”/>; 

1381 if (byline != null && byline != “”){ 

1382 componentData.byline = []; 

1383 };  

1384 #if> 

1385 <#if structureName == “Link” || structureName == “External Article” || structureName == “Video”> 

1386 var linkURL = <@entryNode document=document field=”LinkURL”/>; 

1387 if (linkURL !== “”){ 

1388 componentData.link = linkURL; 

1389 } 

1390 #if> 

1391 <#if structureName == “Video”> 

1392 var videoURL = <@entryNode document=document field=”VideoURL”/>; 

1393 if (videoURL !== “”){ 

1394 componentData.videoURL = videoURL; 

1395 } 

1396 #if> 

1397 entries.push(componentData); 

1398 #list> 

1399 #if> 

1400 

1401var componentVoiceSearch = “article”;  

1402var extraProps = { 

1403 multiArtBehavior: “${multiArtBehavior}”, 

1404 gridTitle: “${gridTitle}”, 

1405 fullWidthDisplay: “${fullWidthDisplay}”, 

1406 greyBackground: “${greyBackground}”, 

1407 extraSpacer: “${extraSpacer}”, 

1408 seeAllLink: “${seeAllLink}”, 

1409 seeAllLinkText: “${seeAllLinkText}”, 

1410 componentVoiceSearch: componentVoiceSearch 

1411 }; 

1412 ATK.React.Component.FeaturedMultiDisplay(“articleAdtDiv_${portletId?js_string}”, extraProps, entries); 

1413#if> 

1414 

1415 

1416<#compress> 

1417<#if (htmlUtil.unescape(Slug.getData()))?lower_case == “article” > 

1418

1419 { 

1420 “@context”: “https://schema.org”, 

1421 “@type”: “Article”, 

1422 “dateModified” : “${modifiedDate}”, 

1423 “datePublished”: “${displayDateForSchema}”, 

1424 <#if (ArticleTitle.getData())?has_content>”headline”: “${(htmlUtil.unescape(ArticleTitle.getData()))?json_string}”,#if> 

1425 <#if answer?has_content> 

1426 <#if answer?contains(“l2it-audio-player”)> 

1427 <#assign answer = answer?json_string?keep_before_last(‘ 

1428 <#else> 

1429 <#assign answer = answer?json_string /> 

1430 #if>  

1431 “description” : “${answer}”,#if> 

1432 <#if imageurlschema?has_content>”image” : “${imageurlschema}”,#if> 

1433 “mainEntityOfPage”: { 

1434 “@type”: “WebPage”, 

1435 “@id”: “${pageurlcurrent}” 

1436 }, 

1437 “author” : [ 

1438 <#if (authorlistschema?size > 0)> 

1439 <#list authorlistschema as author>  

1440 { 

1441 “@type” : “Person”, 

1442 <#list author as cur_author_key, cur_author_value> 

1443 <#if cur_author_key==”url” && cur_author_value?has_content>”${cur_author_key}” : “${cur_author_value}”,#if>  

1444 <#if cur_author_key==”jobTitle” && cur_author_value?has_content>”${cur_author_key}” : “${cur_author_value}”,#if> 

1445 <#if cur_author_key==”name” && cur_author_value?has_content>”${cur_author_key}” : “${cur_author_value}”#if> 

1446  

1447 #list> 

1448 }<#if (author?index != (authorlistschema?size)-1)>,#if> 

1449 #list>  

1450 #if> 

1451 ], 

1452 “publisher”: { 

1453 “@type”: “Organization”, 

1454 “@id”: “https://www.kearney.com#organization” 

1455 } 

1456 } 

1457  

1458<#elseif (htmlUtil.unescape(Slug.getData()))?lower_case == “question and answer” > 

1459

1460 {  

1461 “@context”: “https://schema.org”, 

1462 “@type”: “FAQPage”, 

1463 “mainEntity”: [{ 

1464 “@type”: “Question”, 

1465 “name”: “${(htmlUtil.unescape(ArticleTitle.getData()))?json_string}”, 

1466 “acceptedAnswer”: { 

1467 “@type”: “Answer”, 

1468 <#if answer?has_content> 

1469 <#if answer?contains(“l2it-audio-player”)> 

1470 <#assign answer = answer?json_string?keep_before_last(‘ 

1471 <#else> 

1472 <#assign answer = answer?json_string /> 

1473 #if>  

1474 “text” : “${answer}”,#if>  

1475 “author” : [ 

1476 <#if (authorlistschema?size > 0)> 

1477 <#list authorlistschema as author>  

1478 { 

1479 “@type” : “Person”, 

1480 <#list author as cur_author_key, cur_author_value>  

1481 <#if cur_author_key==”url” && cur_author_value?has_content>”${cur_author_key}” : “${cur_author_value}”,#if>  

1482 <#if cur_author_key==”jobTitle” && cur_author_value?has_content>”${cur_author_key}” : “${cur_author_value}”,#if> 

1483 <#if cur_author_key==”name” && cur_author_value?has_content>”${cur_author_key}” : “${cur_author_value}”#if> 

1484  

1485 #list> 

1486 }<#if (author?index != (authorlistschema?size)-1)>,#if> 

1487 #list>  

1488 #if> 

1489 ] 

1490 } 

1491 }] 

1492 } 

1493  

1494 #if> 

1495 #compress> 

1496  

1497  

1498

1499// Listen for Liferay’s SPA navigation event 

1500if (window.Liferay && Liferay.on) { 

1501 Liferay.on(‘endNavigate’, function() { 

1502 // If the new page contains the audio player container, initialize Listen2It 

1503 if (document.getElementById(‘l2it-audio-player’)) { 

1504 // Check if Listen2It has already been loaded; if not, load it. 

1505 if (typeof Listen2It === ‘undefined’) { 

1506 try { 

1507 initialize(document, “listen2it-widget”); 

1508 } 

1509 catch(error) { 

1510 console.error(“Error with Listen2it Audio:”, error); 

1511 } 

1512 } 

1513 else { 

1514 // If the widget is already loaded, just initialize it for the new page 

1515 try { 

1516 initListen2It(); 

1517 } 

1518 catch(error) { 

1519 console.error(“Error with initialization Listen2it Audio:”, error); 

1520 } 

1521 } 

1522 } 

1523 }); 

1524} 

1525 

1526  

1527  

1528

1529$(document).ready(function() { 

1530 

1531$(“#linkedInShare”).on( “click”, function() { 

1532 Analytics.track(‘socialShare’,{ 

1533 ‘propertyName’: ‘socialShare’, 

1534 <#if (ArticleTitle.getData())?has_content>”articleTitle”: “${(htmlUtil.unescape(ArticleTitle.getData()))?json_string}”,#if> 

1535 ‘socialPlatform’:’Linkedin’, 

1536 ‘pageURL’:themeDisplay.getLayoutURL() 

1537 }); 

1538 }) 

1539  

1540 $(“#twitterShare”).on( “click”, function() { 

1541 Analytics.track(‘socialShare’,{ 

1542 ‘propertyName’: ‘socialShare’, 

1543 <#if (ArticleTitle.getData())?has_content>”articleTitle”: “${(htmlUtil.unescape(ArticleTitle.getData()))?json_string}”,#if> 

1544 ‘socialPlatform’:’Twitter’, 

1545 ‘pageURL’:themeDisplay.getLayoutURL() 

1546 }); 

1547 }) 

1548 

1549 $(“#facebookShare”).on( “click”, function() { 

1550 Analytics.track(‘socialShare’,{ 

1551 ‘propertyName’: ‘socialShare’, 

1552 <#if (ArticleTitle.getData())?has_content>”articleTitle”: “${(htmlUtil.unescape(ArticleTitle.getData()))?json_string}”,#if> 

1553 ‘socialPlatform’:’Facebook’, 

1554 ‘pageURL’:themeDisplay.getLayoutURL() 

1555 }); 

1556 }) 

1557  

1558 $(“#printIcon”).on( “click”, function() { 

1559 Analytics.track(‘printPage’,{ 

1560 ‘propertyName’: ‘printPage’, 

1561 <#if (ArticleTitle.getData())?has_content>”articleTitle”: “${(htmlUtil.unescape(ArticleTitle.getData()))?json_string}”,#if> 

1562 ‘pageURL’:themeDisplay.getLayoutURL() 

1563 }); 

1564 }) 

1565  

1566}); 

1567