Changes for page Hjem

Last modified by Normann P. Nielsen on 2026/11/20 07:06

From version 17.1
edited by Normann P. Nielsen
on 2026/11/17 21:45
Change comment: There is no comment for this version
To version 31.1
edited by Normann P. Nielsen
on 2026/11/18 18:07
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -13,15 +13,46 @@
13 13  )))|=(((
14 14  = Nyeste sider =
15 15  
16 -{{liveData
17 - id="recentPages"
18 - source="liveTable"
19 - sourceParameters="translationPrefix=platform.index."
20 - properties="doc.title,doc.location,doc.creationDate"
21 - sort="doc.creationDate:desc"
22 - limit="10"
23 -/}}
16 +{{velocity}}
17 +#set ($hql = "
18 + select doc.fullName
19 + from XWikiDocument doc
20 + where doc.hidden = false
21 + and doc.fullName not in (
22 + select obj.name
23 + from BaseObject obj
24 + where obj.className = 'Blog.BlogPostClass'
25 + )
26 + order by doc.creationDate desc
27 +")
24 24  
29 +#set ($query = $services.query.hql($hql))
30 +#set ($discard = $query.setLimit(500))
31 +#set ($pages = $query.execute())
32 +#set ($count = 0)
33 +
34 +#foreach ($pageName in $pages)
35 + #if ($count < 10)
36 + #set ($page = $xwiki.getDocument($pageName))
37 +
38 + ## Check permissions for the current user
39 + #set ($canView = $xwiki.hasAccessLevel(
40 + 'view', $context.user, $pageName
41 + ))
42 +
43 + #if ($canView)
44 + #set ($tags = $services.tag.getTagsForDocument($pageName))
45 +
46 + #if (!$tags.contains('noshow'))
47 +->[[${page.title}>>${page.fullName}]]
48 + #set ($count = $count + 1)
49 + #end
50 + #end
51 + #end
52 +#end
53 +{{/velocity}}
54 +
55 +
25 25  
26 26  )))
27 27