文档更改Home

Yang Sheng 于 2025-02-42,18:57 最后修改

从版本 211.1
Yang Sheng编辑
在2025-02-42,18:53上
修改评论: 该版本没有评论
到版本
Yang Sheng编辑
在2025-02-42,18:57上
修改评论: 该版本没有评论

摘要

细节

页面属性
内容
... ... @@ -50,48 +50,4 @@
50 50  
51 51  )))
52 52  
53 -{{velocity}}
54 -## 检查当前用户是否是访客
55 -#if($xcontext.user == 'XWiki.XWikiGuest')
56 - {{info}}请登录查看。{{/info}}
57 -#else
58 - #set($topLevelPages = ["Knowledge", "AI", "Automatic"])
59 59  
60 - #foreach($topPage in $topLevelPages)
61 - #set($hqlQuery = "select doc.fullName from XWikiDocument doc where doc.fullName like :spacePattern and doc.name != 'WebPreferences' order by doc.date desc")
62 - #set($query = $services.query.hql($hqlQuery))
63 - #set($query = $query.bindValue("spacePattern", "${topPage}.%"))
64 - #set($query = $query.setLimit(5))
65 - #set($recentDocs = $query.execute())
66 -
67 - ----
68 - ==== $topPage ====
69 - #if($recentDocs.size() > 0)
70 - #foreach($docFullName in $recentDocs)
71 - #set($document = $xwiki.getDocument($docFullName))
72 -
73 - #set($title = $document.getTitle())
74 - #if($title == '' || $title == $null)
75 - #set($title = $document.getName())
76 - #end
77 -
78 - #set($pathParts = $docFullName.split("\\.")) ## 分割路径
79 - #set($displayPath = "")
80 - #if($pathParts.size() > 2)
81 - ## 提取路径中的二级页面和后续部分
82 - #set($displayPath = $pathParts[1])
83 - #foreach($part in $pathParts.subList(2, $pathParts.size() - 1))
84 - #set($displayPath = "${displayPath}.${part}")
85 - #end
86 - #end
87 -
88 - ## 如果路径解析出有效内容,显示路径和标题
89 - * [[${displayPath}.${title}>>${document.getExternalURL('view')}]] (最后更新: $datetool.format("yyyy-MM-dd HH:mm", $document.getDate()))
90 - #end
91 - #else
92 - **此分类暂无内容**
93 - #end
94 - ----
95 - #end
96 -#end
97 -{{/velocity}}