The following has evaluated to null or missing: ==> xPathSelector.selectSingleNode(element.root) [in template "34847455847212#47755#557623" at line 146, column 38] ---- 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 categoryRef = xPathSelector.s... [in template "34847455847212#47755#557623" at line 146, column 17] ----
1<#--
2 Widget Template
3 Type: Asset Publisher Template
4 Name: [pt] Lista de sites
5 [en] List of sites
6-->
7
8<#assign prefix = "kol" />
9
10<#assign sitesKlabin = "" />
11<#assign appsKlabin = "" />
12<#assign socialKlabin = "" />
13
14<#assign sitesKlabinCount = 0/>
15<#assign socialKlabinCount = 0 />
16
17<#function isExternal url>
18 <#return !url?contains(themeDisplay.getPortalURL()) && ( url?starts_with("http://") || url?starts_with("https://") ) />
19</#function>
20
21<#function isUrl url>
22 <#return url?has_content />
23</#function>
24<#function getRootElement curEntry>
25 <#assign assetRenderer = curEntry.getAssetRenderer() />
26 <#assign article = assetRenderer.getArticle() />
27 <#assign document = saxReaderUtil.read(article.getContentByLocale(locale)) />
28 <#return { "root": document.getRootElement(), "article": article } />
29</#function>
30<#function getSingleNode name root>
31 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='${name}']/dynamic-content") />
32 <#if !xPathSelector??>
33 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='${name}']") />
34 </#if>
35 <#return xPathSelector.selectSingleNode( root ) />
36</#function>
37<#function getNodes name root>
38 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='${name}']") />
39 <#return xPathSelector.selectNodes( root ) />
40</#function>
41
42<style>
43 .${prefix}-mobile-nav-sites-klabin__icon-app {
44 padding: 0 !important;
45 }
46 .${prefix}-mobile-nav-sites-klabin__container {
47 display: flex;
48 flex: 1;
49 flex-direction: column;
50 background: #eeeae1;
51 }
52 .${prefix}-mobile-nav-sites-klabin__container-title {
53 display: flex;
54 width: 100%;
55 height: 28px;
56 flex-direction: row;
57 background: #eeeae1;
58 align-items: center;
59 justify-content: flex-start;
60 padding: 0 0 0 35px;
61 }
62 .${prefix}-mobile-nav-sites-klabin__title {
63 font-family: Raleway;
64 font-style: normal;
65 font-weight: 800;
66 font-size: 12px;
67 line-height: 14px;
68 text-transform: uppercase;
69 font-feature-settings: "pnum" on, "lnum" on;
70 color: #8b9f37;
71 margin: 0;
72 }
73 .${prefix}-mobile-nav-sites-klabin__container-item {
74 width: 100%;
75 height: 70px;
76 display: flex;
77 flex-direction: row;
78 align-items: center;
79 justify-content: space-between;
80 background: #f5f2e9;
81 border-bottom: 1px solid #d9d3c8;
82 }
83 .${prefix}-mobile-nav-sites-klabin__container-item-title {
84 display: flex;
85 flex-direction: row;
86 align-items: center;
87 justify-content: flex-start;
88 }
89 .${prefix}-mobile-nav-sites-klabin__item-title {
90 font-family: Raleway;
91 font-style: normal;
92 font-weight: 600;
93 font-size: 16px;
94 line-height: 14px;
95 font-feature-settings: "pnum" on, "lnum" on;
96 color: #3d4b14 !important;
97 }
98 .${prefix}-mobile-nav-sites-klabin__container-icons {
99 display: flex;
100 flex-direction: row;
101 }
102 .${prefix}-mobile-nav-sites-klabin__icon-app {
103 display: flex;
104 align-items: center;
105 justify-content: center;
106 padding: 0 !important;
107 }
108 .${prefix}-mobile-nav-sites-klabin__action-bottom {
109 width: 100%;
110 height: 36px;
111 display: flex;
112 align-items: center;
113 justify-content: center;
114 background: #eeeae1;
115 margin: 12px 0 0 0;
116 font-family: Raleway;
117 font-style: normal;
118 font-weight: 800 !important;
119 font-size: 12px;
120 line-height: 14px;
121 text-align: center;
122 text-transform: uppercase !important;
123 font-feature-settings: "pnum" on, "lnum" on;
124 color: #009039 !important;
125 }
126 .${prefix}-mobile-nav-sites-klabin__action-bottom:after {
127 display: none;
128 }
129 a.${prefix}-mobile-nav-sites-klabin__icon-app {
130 padding-left: 10px!important;
131 }
132</style>
133
134<#if entries?has_content>
135 <div class="${prefix}-mobile-nav-sites-klabin__container">
136 <div class="${prefix}-mobile-nav-sites-klabin__container-title">
137 <h6 class="${prefix}-mobile-nav-sites-klabin__title">${languageUtil.get(request, "sites-e-apps-klabin")}</h6>
138 </div>
139 <#list entries as entry>
140 <#assign assetRenderer=entry.getAssetRenderer() />
141 <#assign article=assetRenderer.getArticle() />
142 <#assign ddmStructure=article.getDDMStructure() />
143 <#assign element = getRootElement(entry) />
144 <#assign title = (getSingleNode("title", element.root).getStringValue()!"")?trim />
145 <#assign xPathSelector=saxReaderUtil.createXPath("dynamic-element [@field-reference='category']/dynamic-content[@language-id='${locale}']") />
146 <#assign categoryRef=xPathSelector.selectSingleNode(element.root).getStringValue()?trim>
147 <#assign xPathSelector=saxReaderUtil.createXPath("dynamic-element [@field-reference='category']") />
148 <#assign categoryNode=xPathSelector.selectSingleNode(element.root)>
149 <#assign categoryFieldName=categoryNode.attribute("name").getValue()?trim />
150 <#assign ddmFormField=ddmStructure.getDDMFormField(categoryFieldName) />
151 <#assign ddmFormFieldOptions=ddmFormField.getDDMFormFieldOptions() />
152 <#assign optionsReferences=ddmFormFieldOptions.getOptionsReferences() />
153 <#assign category = optionsReferences[categoryRef] />
154 <#assign siteLink = (getSingleNode("siteLink", element.root).getStringValue()!"")?trim />
155 <#assign androidLink = (getSingleNode("androidLink", element.root).getStringValue()!"")?trim />
156 <#assign iOSLink = (getSingleNode("iOSLink", element.root).getStringValue()!"")?trim />
157
158 <#if (category?lower_case == "sites" || category?lower_case == "apps") && highlightLink == "true" && sitesKlabinCount < 6>
159 <#assign sitesKlabinCount += 1>
160 <#assign sitesKlabin>
161 ${sitesKlabin}
162 <#if category?lower_case == "sites">
163 <a class="${prefix}-mobile-nav-sites-klabin__container-item" ${isExternal(siteLink)?string('target="_blank"', '')} ${isUrl(siteLink)?string('href="${siteLink}"', '')} target="_blank" ${isUrl(siteLink)?string('style="cursor: pointer;"', 'style="cursor: default;"')}>
164 <p class="${prefix}-mobile-nav-sites-klabin__item-title">${title}</p>
165 <!-- <svg width="11" height="21" viewBox="0 0 11 21" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1 19.5L10 10.5L0.999999 1.5" stroke="#3D4B14" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/> </svg> -->
166 </a>
167 <#elseif category?lower_case == "apps">
168 <div class="${prefix}-mobile-nav-sites-klabin__container-item">
169 <div class="${prefix}-mobile-nav-sites-klabin__container-item-title">
170 <a ${isUrl(siteLink)?string('href="${siteLink}"', '')} ${isExternal(siteLink)?string('target="_blank"', '')} class="${prefix}-mobile-nav-sites-klabin__item-title" ${isUrl(siteLink)?string('style="cursor: pointer;"', 'style="cursor: default;"')}>${title}</a>
171 <div class="${prefix}-mobile-nav-sites-klabin__container-icons">
172 <#if iOSLink?has_content>
173 <a class="${prefix}-mobile-nav-sites-klabin__icon-app" ${isUrl(iOSLink)?string('href="${iOSLink}"', '')} target="_blank">
174 <svg width="14" height="18" viewBox="0 0 11 14" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M8.12235 0C6.65345 0.500204 5.50872 1.00041 5.67194 3.16796C7.14083 2.83449 8.44878 2.00082 8.12235 0ZM3.45723 3.00957C2.04296 3.00957 0.000123978 4.27675 0.000123978 6.65272C0.000123978 9.97909 2.2001 13.3054 3.45723 13.3054C4.40007 13.3054 5.18578 12.6719 5.81434 12.6719C6.44291 12.6719 7.07147 13.3054 8.01432 13.3054C9.27145 13.3054 10.6857 11.4047 11 9.66229C9.90001 8.8703 9.11431 8.39511 9.11431 6.96952C9.11431 6.01913 9.90001 5.06875 10.8429 4.27675C10.3714 3.64316 9.42859 3.00957 8.48574 3.00957C7.5429 3.00957 6.52901 3.7615 5.81434 3.80156C5.18578 3.80156 4.40007 3.00957 3.45723 3.00957Z" fill="#8B9F37"/> </svg>
175 </a>
176 </#if>
177 <#if androidLink?has_content>
178 <a class="${prefix}-mobile-nav-sites-klabin__icon-app" ${isUrl(androidLink)?string('href="${androidLink}"', '')} target="_blank">
179 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body_1" width="14" height="14"> <g transform="matrix(0.8235294 0 0 0.8235294 0 0)"> <g transform="matrix(0.7083334 0 0 0.7083334 0 0)"> </g> <path transform="matrix(0.7083334 0 0 0.7083334 0 0)" d="M1.571 23.664L12.102 13.163L15.814 16.864L3.295 23.805C 2.819 24.069 2.236 24.065 1.763 23.794L1.763 23.794L1.571 23.664zM11.04 12.104L1 22.115L1 2.092999L11.04 12.104zM17.314 7.966999L22.219 10.686C 22.701 10.954 23 11.456 23 12C 23 12.544 22.701 13.046 22.219 13.314L22.219 13.314L17.18 16.107L13.165 12.104L17.314 7.966998zM1.459999 0.4329991C 1.549999 0.3459991 1.650999 0.2699991 1.762999 0.2059991C 2.235999 -0.06500086 2.818999 -0.06900087 3.294999 0.1949991L3.294999 0.1949991L15.948 7.209999L12.102 11.045L1.459999 0.4329987z" stroke="none" fill="#8B9F37" fill-rule="nonzero" /> </g> </svg>
180 </a>
181 </#if>
182 </div>
183 </div>
184 <!-- <a ${isUrl(siteLink)?string('href="${siteLink}"', '')}>
185 <svg width="11" height="21" viewBox="0 0 11 21" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1 19.5L10 10.5L0.999999 1.5" stroke="#3D4B14" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/> </svg>
186 </a> -->
187 </div>
188 </#if>
189 </#assign>
190 <#elseif category?lower_case == "socialmedia" && highlightLink == "true" && sitesKlabinCount < 6>
191 <#assign socialKlabinCount += 1>
192 <#assign socialKlabin>
193 ${socialKlabin}
194 <a class="${prefix}-mobile-nav-sites-klabin__container-item" ${isExternal(siteLink)?string('target="_blank"', '')} ${isUrl(siteLink)?string('href="${siteLink}"', '')} target="_blank" ${isUrl(siteLink)?string('style="cursor: pointer;"', 'style="cursor: default;"')}>
195 <p class="${prefix}-mobile-nav-sites-klabin__item-title">${title}</p>
196 <!-- <svg width="11" height="21" viewBox="0 0 11 21" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1 19.5L10 10.5L0.999999 1.5" stroke="#3D4B14" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/> </svg> -->
197 </a>
198 </#assign>
199 </#if>
200 </#list>
201 ${sitesKlabin}
202 <div class="${prefix}-mobile-nav-sites-klabin__container-title">
203 <h6 class="${prefix}-mobile-nav-sites-klabin__title">${languageUtil.get(request, "redes-sociais-klabin")}</h6>
204 </div>
205 ${socialKlabin}
206 <a href="/sites-klabin" class="${prefix}-mobile-nav-sites-klabin__action-bottom">${languageUtil.get(request, "sites-klabin-see-all-list")}</a>
207 </div>
208</#if>
+55 (11) 97953-3213
+ 55 (11) 98277-5017
+ 55 (11) 94729-2219