Changes for page Hjem

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

From version 18.1
edited by Normann P. Nielsen
on 2026/11/17 21:46
Change comment: There is no comment for this version
To version 27.1
edited by Normann P. Nielsen
on 2026/11/18 18:05
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -27,18 +27,33 @@
27 27  ")
28 28  
29 29  #set ($query = $services.query.hql($hql))
30 -#set ($discard = $query.setLimit(10))
30 +#set ($discard = $query.setLimit(500))
31 31  #set ($pages = $query.execute())
32 +#set ($count = 0)
32 32  
33 33  (% class="recent-pages" %)
34 -|=Page|=Created
35 35  #foreach ($pageName in $pages)
36 - #set ($page = $xwiki.getDocument($pageName))
37 - #if ($page.hasAccessLevel('view'))
38 -|[[${page.title}>>${page.fullName}]]|$datetool.format('dd-MM-yyyy', $page.creationDate)
36 + #if ($count < 10)
37 + #set ($page = $xwiki.getDocument($pageName))
38 +
39 + ## Check permissions for the current user
40 + #set ($canView = $xwiki.hasAccessLevel(
41 + 'view', $context.user, $pageName
42 + ))
43 +
44 + #if ($canView)
45 + #set ($tags = $services.tag.getTagsForDocument($pageName))
46 +
47 + #if (!$tags.contains('noshow'))
48 +[[${page.title}>>${page.fullName}]]|$datetool.format('dd-MM-yyyy', $page.creationDate)
49 + #set ($count = $count + 1)
50 + #end
51 + #end
39 39   #end
40 40  #end
41 41  {{/velocity}}
55 +
56 +
42 42  
43 43  )))
44 44