テンプレート処理中にエラーが発生しました。
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 31, 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 31, column 9] ----
1<script>
2 const _addEventListener = (selectors) => {
3 var elements = document.querySelectorAll(selectors);
4
5 elements.forEach((element) => {
6 element.addEventListener("click", (event) => {
7 event.preventDefault();
8
9 const anchorElement = document.getElementById(element.getAttribute("id").replace("toc-", ""));
10
11 if (anchorElement) {
12 window.scrollTo({
13 behavior: "smooth",
14 top: anchorElement.getBoundingClientRect().top + window.scrollY - 190,
15 });
16 }
17 });
18 });
19 }
20
21 window.addEventListener('load', function() {
22 _addEventListener("h1 a, h2 a, h3 a");
23 _addEventListener(".toc li a");
24 });
25</script>
26
27<#assign
28 journalArticleId = .vars["reserved-article-id"].data
29 navigationJSONObject = jsonFactoryUtil.createJSONObject(navigation.getData())
30 taxonomyCategoriesMap = {}
31 taxonomyCategoryBriefs = restClient.get("/headless-delivery/v1.0/sites/${groupId}/structured-contents/by-key/${journalArticleId}?nestedFields=embeddedTaxonomyCategory").taxonomyCategoryBriefs
32 taxonomyVocabularies = []
33
34 childrenJSONArray = navigationJSONObject.getJSONArray("children")
35 breadcrumbJSONArray = navigationJSONObject.getJSONArray("breadcrumb")
36 showChildrenCards = showChildrenCards.getData()?boolean
37/>
38
39<#list taxonomyCategoryBriefs as taxonomyCategoryBrief>
40 <#assign taxonomyVocabularyName = taxonomyCategoryBrief.embeddedTaxonomyCategory.parentTaxonomyVocabulary.name />
41
42 <#if !taxonomyVocabularies?seq_contains(taxonomyVocabularyName)>
43 <#assign taxonomyVocabularies = taxonomyVocabularies + [taxonomyVocabularyName] />
44 </#if>
45
46 <#if taxonomyCategoriesMap[taxonomyVocabularyName]?has_content>
47 <#assign taxonomyCategoriesMap = taxonomyCategoriesMap +
48 {
49 taxonomyVocabularyName:
50 taxonomyCategoriesMap[taxonomyVocabularyName] + [{
51 "categoryId": taxonomyCategoryBrief.taxonomyCategoryId,
52 "categoryName": taxonomyCategoryBrief.taxonomyCategoryName
53 }]
54 }
55 />
56 <#else>
57 <#assign taxonomyCategoriesMap = taxonomyCategoriesMap +
58 {
59 taxonomyVocabularyName:
60 [{
61 "categoryId": taxonomyCategoryBrief.taxonomyCategoryId,
62 "categoryName": taxonomyCategoryBrief.taxonomyCategoryName
63 }]
64 }
65 />
66 </#if>
67</#list>
68
69<article class="learn-article">
70 <div class="d-flex flex-column">
71 <div class="learn-article-breadcrumbs">
72 <div class="learn-article-breadcrumbs-content">
73 <div class="align-items-baseline d-flex justify-content-between mb-3">
74 <ul
75 aria-label="breadcrumb navigation"
76 class="learn-article-breadcrumb"
77 role="navigation"
78 >
79 <li>
80 <a href="/"><@clay["icon"] symbol="home-full" /></a>
81 </li>
82
83 <#if breadcrumbJSONArray.length() gt 0>
84 <#list breadcrumbJSONArray.length()-1..0 as i>
85 <li>
86 <a href='${breadcrumbJSONArray.getJSONObject(i).getString("url")}'>${breadcrumbJSONArray.getJSONObject(i).getString("title")}</a>
87 </li>
88 </#list>
89 </#if>
90
91 <li>
92 ${navigationJSONObject.getJSONObject("self").getString("title")}
93 </li>
94 </ul>
95
96 <div class="submit-feedback">
97 <a
98 class="text-decoration-none"
99 href="https://liferay.dev/c/portal/login?redirect=https://liferay.dev/ask/questions/liferay-learn-feedback/new"
100 >
101 ${languageUtil.get(locale, "submit-feedback", "Submit Feedback")}
102 <@clay["icon"] symbol="message-boards" />
103 </a>
104 </div>
105 </div>
106 </div>
107 </div>
108
109 <div class="learn-article-wrapper">
110 <div class="language-log learn-article-content">
111 <#if (content.getData())??>
112 ${content.getData()}
113 </#if>
114
115 <#if showChildrenCards && childrenJSONArray.length() gt 0>
116 <div class="learn-card-container">
117 <#list 0..childrenJSONArray.length()-1 as i>
118 <#assign childJSONObject = childrenJSONArray.getJSONObject(i) />
119
120 <div class="learn-card">
121 <a href="${childJSONObject.getString("url")}">
122 <h4>${childJSONObject.getString("title")}</h4>
123 </a>
124
125 <#if childJSONObject.getJSONArray("children")?? && childJSONObject.getJSONArray("children").length() gt 0>
126 <#assign grandchildrenJSONArray = childJSONObject.getJSONArray("children") />
127
128 <div class="mt-2 subsection">
129 <#list 0..grandchildrenJSONArray.length()-1 as j>
130 <#assign grandchildJSONObject = grandchildrenJSONArray.getJSONObject(j) />
131
132 <a href="${grandchildJSONObject.getString("url")}">
133 ${grandchildJSONObject.getString("title")}
134 </a>
135 </#list>
136 </div>
137 </#if>
138 </div>
139 </#list>
140 </div>
141 </#if>
142
143 <div class="learn-article-categories-tags">
144 <#list taxonomyVocabularies as vocabulary>
145 <div class="align-items-baseline d-flex mt-2">
146 <div class="learn-article-category-title mr-2">
147 ${vocabulary}:
148 </div>
149 <#list taxonomyCategoriesMap[vocabulary]?sort_by("categoryName") as taxonomyCategory>
150 <div class="learn-article-category-tag mr-2">
151 <a
152 class="label tag-container"
153 href="/search?category=${taxonomyCategory.categoryId}"
154 >
155 <span>${taxonomyCategory.categoryName}</span>
156 </a>
157 </div>
158 </#list>
159 </div>
160 </#list>
161 </div>
162 </div>
163
164 <div class="learn-article-page-nav">
165 <ul class="nav nav-stacked toc" id="articleTOC"></ul>
166 </div>
167 </div>
168 </div>
169</article>
Capabilities
Product
Education
Contact Us
Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy