An error occurred while processing the template.
The following has evaluated to null or missing: ==> restClient.get("/headless-delivery/v1.0/sites/${groupId}/structured-contents/by-key/${journalArticleId}?nestedFields=embeddedTaxonomyCategory").taxonomyCategoryBriefs [in template "8911408109993434201#23484949#LEARN-ARTICLE" at line 5, column 34] ---- 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: taxonomyCategoryBriefs = restClient.g... [in template "8911408109993434201#23484949#LEARN-ARTICLE" at line 5, column 9] ----
1<#assign
2 journalArticleId = .vars["reserved-article-id"].data
3 navigationJSONObject = jsonFactoryUtil.createJSONObject(navigation.getData())
4 taxonomyCategoriesMap = {}
5 taxonomyCategoryBriefs = restClient.get("/headless-delivery/v1.0/sites/${groupId}/structured-contents/by-key/${journalArticleId}?nestedFields=embeddedTaxonomyCategory").taxonomyCategoryBriefs
6 taxonomyVocabularies = []
7
8 childrenJSONArray = navigationJSONObject.getJSONArray("children")
9 breadcrumbJSONArray = navigationJSONObject.getJSONArray("breadcrumb")
10 showChildrenCards = showChildrenCards.getData()?boolean
11/>
12
13<#list taxonomyCategoryBriefs as taxonomyCategoryBrief>
14 <#assign taxonomyVocabularyName = taxonomyCategoryBrief.embeddedTaxonomyCategory.parentTaxonomyVocabulary.name />
15
16 <#if !taxonomyVocabularies?seq_contains(taxonomyVocabularyName)>
17 <#assign taxonomyVocabularies = taxonomyVocabularies + [taxonomyVocabularyName] />
18 </#if>
19
20 <#if taxonomyCategoriesMap[taxonomyVocabularyName]?has_content>
21 <#assign taxonomyCategoriesMap = taxonomyCategoriesMap +
22 {
23 taxonomyVocabularyName:
24 taxonomyCategoriesMap[taxonomyVocabularyName] + [{
25 "categoryId": taxonomyCategoryBrief.taxonomyCategoryId,
26 "categoryName": taxonomyCategoryBrief.taxonomyCategoryName
27 }]
28 }
29 />
30 <#else>
31 <#assign taxonomyCategoriesMap = taxonomyCategoriesMap +
32 {
33 taxonomyVocabularyName:
34 [{
35 "categoryId": taxonomyCategoryBrief.taxonomyCategoryId,
36 "categoryName": taxonomyCategoryBrief.taxonomyCategoryName
37 }]
38 }
39 />
40 </#if>
41</#list>
42
43<article class="learn-article">
44 <div class="d-flex flex-column">
45 <div class="learn-article-breadcrumbs">
46 <div class="learn-article-breadcrumbs-content">
47 <div class="align-items-baseline d-flex justify-content-between mb-3">
48 <ul
49 aria-label="breadcrumb navigation"
50 class="learn-article-breadcrumb"
51 role="navigation"
52 >
53 <li>
54 <a href="/"><@clay["icon"] symbol="home-full" /></a>
55 </li>
56
57 <#if breadcrumbJSONArray.length() gt 0>
58 <#list breadcrumbJSONArray.length()-1..0 as i>
59 <li>
60 <a href='${breadcrumbJSONArray.getJSONObject(i).getString("url")}'>${breadcrumbJSONArray.getJSONObject(i).getString("title")}</a>
61 </li>
62 </#list>
63 </#if>
64
65 <li>
66 ${navigationJSONObject.getJSONObject("self").getString("title")}
67 </li>
68 </ul>
69
70 <div class="submit-feedback">
71 <a
72 class="text-decoration-none"
73 href="https://liferay.dev/c/portal/login?redirect=https://liferay.dev/ask/questions/liferay-learn-feedback/new"
74 >
75 ${languageUtil.get(locale, "submit-feedback", "Submit Feedback")}
76 <@clay["icon"] symbol="message-boards" />
77 </a>
78 </div>
79 </div>
80 </div>
81 </div>
82
83 <div class="learn-article-wrapper">
84 <div class="language-log learn-article-content">
85 <#if (content.getData())??>
86 ${content.getData()}
87 </#if>
88
89 <#if showChildrenCards && childrenJSONArray.length() gt 0>
90 <div class="learn-card-container">
91 <#list 0..childrenJSONArray.length()-1 as i>
92 <#assign childJSONObject = childrenJSONArray.getJSONObject(i) />
93
94 <div class="learn-card">
95 <a href="${childJSONObject.getString("url")}">
96 <h4>${childJSONObject.getString("title")}</h4>
97 </a>
98
99 <#if childJSONObject.getJSONArray("children")?? && childJSONObject.getJSONArray("children").length() gt 0>
100 <#assign grandchildrenJSONArray = childJSONObject.getJSONArray("children") />
101
102 <div class="mt-2 subsection">
103 <#list 0..grandchildrenJSONArray.length()-1 as j>
104 <#assign grandchildJSONObject = grandchildrenJSONArray.getJSONObject(j) />
105
106 <a href="${grandchildJSONObject.getString("url")}">
107 ${grandchildJSONObject.getString("title")}
108 </a>
109 </#list>
110 </div>
111 </#if>
112 </div>
113 </#list>
114 </div>
115 </#if>
116
117 <div class="learn-article-categories-tags">
118 <#list taxonomyVocabularies as vocabulary>
119 <div class="align-items-baseline d-flex mt-2">
120 <div class="learn-article-category-title mr-2">
121 ${vocabulary}:
122 </div>
123 <#list taxonomyCategoriesMap[vocabulary]?sort_by("categoryName") as taxonomyCategory>
124 <div class="learn-article-category-tag mr-2">
125 <a
126 class="label tag-container"
127 href="/search?category=${taxonomyCategory.categoryId}"
128 >
129 <span>${taxonomyCategory.categoryName}</span>
130 </a>
131 </div>
132 </#list>
133 </div>
134 </#list>
135 </div>
136 </div>
137
138 <div class="learn-article-page-nav">
139 <ul class="nav nav-stacked toc" id="articleTOC"></ul>
140 </div>
141 </div>
142 </div>
143</article>
Capabilities
Product
Contact Us
Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy