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