437 Products Available
An error occurred while processing the template.
The following has evaluated to null or missing: ==> webContent.totalCount [in template "37794063322763#20119#220604" at line 13, column 38] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- 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: totalCount = webContent.totalCount [in template "37794063322763#20119#220604" at line 13, column 25] ----
1<#--
2Widget templates can be used to modify the look of a
3specific application.
4
5Please use the right panel to quickly add commonly used variables.
6Autocomplete is also available and can be invoked by typing "${".
7-->
8<#if assetCategory?has_content>
9 <#assign
10 link = "/headless-delivery/v1.0/content-structures/1404290/structured-contents?filter=taxonomyCategoryIds/any(t:t eq " + assetCategory.getCategoryId() + ")"
11 webContent = restClient.get("/headless-delivery/v1.0/content-structures/1404290/structured-contents?filter=taxonomyCategoryIds/any(t:t eq " + assetCategory.getCategoryId() + ")")
12 categoryContentJson = jsonFactoryUtil.createJSONObject(webContent)
13 totalCount = webContent.totalCount
14 />
15
16 <#if totalCount = 1>
17 <#list webContent.items as item>
18 <#list item.contentFields as contentField>
19 <#assign categoryDesc = jsonFactoryUtil.createJSONObject(contentField.contentFieldValue) />
20 <p>
21 ${categoryDesc.data}
22 </p>
23 </#list>
24 </#list>
25 <#else>
26 <#if assetCategory.name?? && assetCategory.name != "" && assetCategory.name == "Used">
27 <h1>Used Trucks</h1>
28 ${assetCategory.getDescription(.locale)}
29 <hr/>
30
31 <#elseif assetCategory.name?? && assetCategory.name != "" && assetCategory.name == "New">
32 <h1>New Trucks</h1>
33 ${assetCategory.getDescription(.locale)}
34 <hr/>
35
36 <#elseif assetCategory.name?? && assetCategory.name != "" && assetCategory.name == "Blacklist">
37 <h1>Sales Specials</h1>
38 ${assetCategory.getDescription(.locale)}
39 <hr/>
40
41 <#else>
42 <h1 class="sr-only">All Products</h1>
43 ${assetCategory.getDescription(.locale)}
44 </#if>
45 </#if>
46</#if>