The following has evaluated to null or missing: ==> xPathSelector.selectSingleNode(element.root) [in template "34847455847212#47755#557623" at line 153, 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 153, 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 <#if xPathSelector.selectSingleNode( root ) != "">
36 <#return xPathSelector.selectSingleNode( root ) />
37 <#else>
38 <#return ""/>
39 </#if>
40 <#--<#return xPathSelector.selectSingleNode( root ) />-->
41</#function>
42<#function getNodes name root>
43 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='${name}']") />
44 <#return xPathSelector.selectNodes( root ) />
45</#function>
46
47<style>
48 .${prefix}-mobile-nav-sites-klabin__icon-app {
49 padding: 0 !important;
50 }
51 .${prefix}-mobile-nav-sites-klabin__container {
52 display: flex;
53 flex: 1;
54 flex-direction: column;
55 background: #eeeae1;
56 }
57 .${prefix}-mobile-nav-sites-klabin__container-title {
58 display: flex;
59 width: 100%;
60 height: 28px;
61 flex-direction: row;
62 background: #eeeae1;socialKlabinCount
63 align-items: center;
64 justify-content: flex-start;
65 padding: 8px 0 0 35px;
66 }
67 .${prefix}-mobile-nav-sites-klabin__title {
68 font-family: Raleway;
69 font-style: normal;
70 font-weight: 800;
71 font-size: 12px;
72 line-height: 14px;
73 text-transform: uppercase;
74 font-feature-settings: "pnum" on, "lnum" on;
75 color: #8b9f37;
76 margin: 0;
77 }
78 .${prefix}-mobile-nav-sites-klabin__container-item {
79 width: 100%;
80 height: 70px;
81 display: flex;
82 flex-direction: row;
83 align-items: center;
84 justify-content: space-between;
85 background: #f5f2e9;
86 border-bottom: 1px solid #d9d3c8;
87 }
88 .${prefix}-mobile-nav-sites-klabin__container-item-title {
89 display: flex;
90 flex-direction: row;
91 align-items: center;
92 justify-content: flex-start;
93 }
94 .${prefix}-mobile-nav-sites-klabin__item-title {
95 font-family: Raleway;
96 font-style: normal;
97 font-weight: 600;
98 font-size: 16px;
99 line-height: 14px;
100 font-feature-settings: "pnum" on, "lnum" on;
101 color: #3d4b14 !important;
102 }
103 .${prefix}-mobile-nav-sites-klabin__container-icons {
104 display: flex;
105 flex-direction: row;
106 }
107 .${prefix}-mobile-nav-sites-klabin__icon-app {
108 display: flex;
109 align-items: center;
110 justify-content: center;
111 padding: 0 !important;
112 }
113 .${prefix}-mobile-nav-sites-klabin__action-bottom {
114 width: 100%;
115 height: 36px;
116 display: flex;
117 align-items: center;
118 justify-content: center;
119 background: #eeeae1;
120 margin: 12px 0 0 0;
121 font-family: Raleway;
122 font-style: normal;
123 font-weight: 800 !important;
124 font-size: 12px;
125 line-height: 14px;
126 text-align: center;
127 text-transform: uppercase !important;
128 font-feature-settings: "pnum" on, "lnum" on;
129 color: #009039 !important;
130 }
131 .${prefix}-mobile-nav-sites-klabin__action-bottom:after {
132 display: none;
133 }
134 a.${prefix}-mobile-nav-sites-klabin__icon-app {
135 padding-left: 10px!important;
136 }
137</style>
138
139<#if entries?has_content>
140 <div class="${prefix}-mobile-nav-sites-klabin__container">
141 <#if sitesKlabinCount gt 0>
142 <div class="${prefix}-mobile-nav-sites-klabin__container-title">
143 <h6 class="${prefix}-mobile-nav-sites-klabin__title">${languageUtil.get(request, "sites-e-apps-klabin")}</h6>
144 </div>
145 </#if>
146 <#list entries as entry>
147 <#assign assetRenderer=entry.getAssetRenderer() />
148 <#assign article=assetRenderer.getArticle() />
149 <#assign ddmStructure=article.getDDMStructure() />
150 <#assign element = getRootElement(entry) />
151 <#assign title = (getSingleNode("title", element.root).getStringValue()!"")?trim />
152 <#assign xPathSelector=saxReaderUtil.createXPath("dynamic-element [@field-reference='category']/dynamic-content[@language-id='${locale}']") />
153 <#assign categoryRef=xPathSelector.selectSingleNode(element.root).getStringValue()?trim>
154 <#assign xPathSelector=saxReaderUtil.createXPath("dynamic-element [@field-reference='category']") />
155 <#assign categoryNode=xPathSelector.selectSingleNode(element.root)>
156 <#assign categoryFieldName=categoryNode.attribute("name").getValue()?trim />
157 <#assign ddmFormField=ddmStructure.getDDMFormField(categoryFieldName) />
158 <#assign ddmFormFieldOptions=ddmFormField.getDDMFormFieldOptions() />
159 <#assign optionsReferences=ddmFormFieldOptions.getOptionsReferences() />
160 <#assign category = optionsReferences[categoryRef] />
161 <#assign siteLink = (getSingleNode("siteLink", element.root).getStringValue()!"")?trim />
162 <#assign androidLink = (getSingleNode("androidLink", element.root).getStringValue()!"")?trim />
163 <#assign iOSLink = (getSingleNode("iOSLink", element.root).getStringValue()!"")?trim />
164
165 <#if (category == "Opção34909757" || category == "Opção19609782") && sitesKlabinCount < 6>
166 <#assign sitesKlabinCount += 1>
167 <#assign sitesKlabin>
168 ${sitesKlabin}
169 <#if category == "Opção34909757">
170 <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;"')}>
171 <p class="${prefix}-mobile-nav-sites-klabin__item-title">${title}</p>
172 <!-- <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> -->
173 </a>
174 <#elseif category == "Opção19609782">
175 <div class="${prefix}-mobile-nav-sites-klabin__container-item">
176 <div class="${prefix}-mobile-nav-sites-klabin__container-item-title">
177 <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>
178 <div class="${prefix}-mobile-nav-sites-klabin__container-icons">
179 <#if iOSLink?has_content>
180 <a class="${prefix}-mobile-nav-sites-klabin__icon-app" ${isUrl(iOSLink)?string('href="${iOSLink}"', '')} target="_blank">
181 <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>
182 </a>
183 </#if>
184 <#if androidLink?has_content>
185 <a class="${prefix}-mobile-nav-sites-klabin__icon-app" ${isUrl(androidLink)?string('href="${androidLink}"', '')} target="_blank">
186 <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>
187 </a>
188 </#if>
189 </div>
190 </div>
191 <!-- <a ${isUrl(siteLink)?string('href="${siteLink}"', '')}>
192 <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>
193 </a> -->
194 </div>
195 </#if>
196 </#assign>
197 <#elseif category == "Opção07409246" && sitesKlabinCount < 6>
198 <#assign socialKlabinCount += 1>
199 <#assign socialKlabin>
200 ${socialKlabin}
201 <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;"')}>
202 <p class="${prefix}-mobile-nav-sites-klabin__item-title">${title}</p>
203 <!-- <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> -->
204 </a>
205 </#assign>
206 </#if>
207 </#list>
208 ${sitesKlabin}
209 <#if socialKlabinCount gt 0>
210 <div class="${prefix}-mobile-nav-sites-klabin__container-title">
211 <h6 class="${prefix}-mobile-nav-sites-klabin__title">${languageUtil.get(request, "redes-sociais-klabin")}</h6>
212 </div>
213 </#if>
214 ${socialKlabin}
215 <a href="/sites-klabin" class="${prefix}-mobile-nav-sites-klabin__action-bottom">${languageUtil.get(request, "sites-klabin-see-all-list")}</a>
216 </div>
217</#if>