修正CMS的ViewConfig
This commit is contained in:
@@ -327,7 +327,7 @@ public class CmsUtils {
|
||||
// 如果试图配置里配置了管理路径,则使用视图中的管理路径
|
||||
if (StringUtils.isNotBlank(category.getViewConfig())) {
|
||||
@SuppressWarnings("rawtypes")
|
||||
Map map = JsonMapper.fromJson("{" + category.getViewConfig().trim() + "}", Map.class);
|
||||
Map map = JsonMapper.fromJson(category.getViewConfig(), Map.class);
|
||||
if (map != null) {
|
||||
// 管理地址
|
||||
String adminUrl = ObjectUtils.toString(map.get("adminUrl"));
|
||||
@@ -465,11 +465,11 @@ public class CmsUtils {
|
||||
public static void addViewConfigAttribute(Model model, String params) {
|
||||
if (StringUtils.isNotBlank(params)) {
|
||||
@SuppressWarnings("rawtypes")
|
||||
Map map = JsonMapper.fromJson("{" + params.trim() + "}", Map.class);
|
||||
Map map = JsonMapper.fromJson(params, Map.class);
|
||||
if (map != null) {
|
||||
for (Object o : map.keySet()) {
|
||||
model.addAttribute("viewConfig_" + o.toString(), map.get(o));
|
||||
}
|
||||
map.forEach((k, v) -> {
|
||||
model.addAttribute("viewConfig_" + k, v);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,8 +213,8 @@
|
||||
<#form:input path="viewConfig" maxlength="1000" class="form-control"
|
||||
placeholder="视图参数例如: {count:2, title_show:'yes'} 则在视图文件中的获取方法是:${'${'}viewConfig_count}、${'${'}viewConfig_titleShow}" />
|
||||
<br />
|
||||
<ul class="text-muted well well-lg no-shadow">
|
||||
<li>例如视图参数设置为:count:2,titleShow:'yes'则在视图文件中的获取方法是:\${viewConfig_count}、\${viewConfig_titleShow}。</li>
|
||||
<ul class="text-muted well well-lg no-shadow m0 pt10 pb10">
|
||||
<li>例如视图参数设置为:{count:2,titleShow:'yes'} 则在视图文件中的获取方法是:\${viewConfig_count}、\${viewConfig_titleShow}。</li>
|
||||
<li>设置栏目的管理地址:若设置【adminUrl:false】表示无管理地址,在内容发布栏目列表中不显示该栏目;</li>
|
||||
<li>设置【adminUrl:'/cms/guestbook'】表示有管理地址,在内容发布栏目列表中点击该栏目链接到该地址。</li>
|
||||
<!-- <li>管理地址参数:若设置【adminUrlParam:'fileDownload=true'】则代表链接模型为文件下载的栏目,新增链接的时候出现文件上传对话框。</li>
|
||||
|
||||
Reference in New Issue
Block a user