jsp - 将速度转换为 freemarker 但不工作
问题描述
我已经为网络内容创建了一个结构和模板,以通过 Asset Publisher 发布文章。
结构源和视图如下所示:
{
"availableLanguageIds": [
"en_US"
],
"defaultLanguageId": "en_US",
"fields": [
{
"label": {
"en_US": " File Title "
},
"predefinedValue": {
"en_US": " "
},
"style": {
"en_US": ""
},
"tip": {
"en_US": " "
},
"dataType": "string",
"indexType": "keyword",
"localizable": true,
"name": "File_Title",
"readOnly": false,
"repeatable": true,
"required": true,
"showLabel": true,
"type": "text",
"nestedFields": [
{
"label": {
"en_US": " Select File "
},
"predefinedValue": {
"en_US": " "
},
"style": {
"en_US": ""
},
"tip": {
"en_US": " Browse the file from NEWS folder present under Disney "
},
"dataType": "document-library",
"fieldNamespace": "ddm",
"indexType": "keyword",
"localizable": true,
"name": "Select_File",
"readOnly": false,
"repeatable": false,
"required": true,
"showLabel": true,
"type": "ddm-documentlibrary"
}
]
}
]
}
看法:
现在标记到上述结构的模板源在 Liferay 6.2 中的速度语言中运行良好,如下所示:
#if (!$File_Title.getSiblings().isEmpty())
#foreach ($cur_File_Title in $File_Title.getSiblings())
<h3>
<a href="$cur_File_Title.Select_File.getData()" target="_blank">$cur_File_Title.getData()</a>
</h3>
#end
#end
有一次,我将我的应用程序迁移到 DXP 7.2 并在我的应用程序中使用相同的结构和模板(选择相同的 .vm 模板语言),资产发布者中的结构视图不允许我在文本框中输入任何值。
因此,我尝试将 Velocity 代码迁移到 freemarker 语言,如下所示。
<#if File_Title.siblings?size !=0>
<#list File_Title.siblings as cur_File_Title>
<h3>
<a href="${cur_File_Title.Select_File.data}" target="_blank">${cur_File_Title.data}</a>
</h3>
</#list>
</#if>
解决方案
推荐阅读
- javascript - 如何在 React Native 中使用 MapLibre GL Js
- excel - 如何在不更改数字格式的情况下将用户窗体中的文本框中的数字导出到工作表
- jquery - Rails 6将输入添加到页面中的列表
- msbuild - 即使出现错误,Azure 管道 msbuild 也会成功?
- javascript - Firestore 更新集合值
- python - 将特定时间格式转换为另一种格式
- php - Laravel 如何解析模型中的一些方法?
- node.js - 在 IISnode 的请求正文中发送带有大数据的发布请求时,在 IIS 中不起作用
- excel - Excel vba combobox.value 读取十进制值的 10 倍
- ubuntu - phpmyadmin 配置路径不起作用