文档更改Home
由 Yang Sheng 于 2025-02-42,18:57 最后修改
摘要
-
页面属性 (1 修改, 0 新增, 0 删除)
细节
- 页面属性
-
- 内容
-
... ... @@ -50,50 +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 - ## 获取标题 74 - #set($title = $document.getTitle()) 75 - #if($title == '' || $title == $null) 76 - #set($title = $document.getName()) 77 - #end 78 - 79 - ## 获取路径并解析为显示格式 80 - #set($pathParts = $docFullName.split("\\.")) ## 分割路径 81 - #set($displayPath = "") 82 - #if($pathParts.size() > 2) 83 - ## 从二级页面开始拼接路径 84 - #set($displayPath = $pathParts[1]) 85 - #foreach($part in $pathParts.subList(2, $pathParts.size())) 86 - #set($displayPath = "${displayPath}.${part}") 87 - #end 88 - #end 89 - 90 - ## 确保显示路径加上标题 91 - * [[${displayPath}>>${document.getExternalURL('view')}]] (最后更新: $datetool.format("yyyy-MM-dd HH:mm", $document.getDate())) 92 - #end 93 - #else 94 - **此分类暂无内容** 95 - #end 96 - ---- 97 - #end 98 -#end 99 -{{/velocity}}