Changes for page Hjem

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

From version 35.1
edited by Normann P. Nielsen
on 2026/11/18 18:48
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
... ... @@ -7,65 +7,53 @@
7 7  = =
8 8  
9 9  |=(((
10 -{{container layoutStyle="columns"}}
11 -(((
12 12  = Nyeste Blogs =
13 13  
14 -{{velocity}}
15 -#set ($hql = "select doc.fullName from XWikiDocument doc where doc.hidden = false and exists (select obj.id from BaseObject obj where obj.name = doc.fullName and obj.className = 'Blog.BlogPostClass') order by doc.creationDate desc")
16 -#set ($query = $services.query.hql($hql))
17 -#set ($discard = $query.setLimit(500))
18 -#set ($pages = $query.execute())
19 -#set ($count = 0)
20 -##
21 -(% class="recent-blogs" %)
22 -|=Blog post|=Created
23 -#foreach ($pageName in $pages)##
24 -#if ($count < 10)##
25 -#set ($canView = $xwiki.hasAccessLevel('view', $context.user, $pageName))##
26 -#if ($canView)##
27 -#set ($tags = $services.tag.getTagsForDocument($pageName))##
28 -#if (!$tags.contains('noshow'))##
29 -#set ($page = $xwiki.getDocument($pageName))##
30 -|[[${page.title}>>${page.fullName}]]|$datetool.format('dd-MM-yyyy', $page.creationDate)
31 -#set ($count = $count + 1)##
32 -#end##
33 -#end##
34 -#end##
35 -#end##
36 -{{/velocity}}
37 -
38 -)))
39 -
40 -(((
12 +{{blogpostlist published="yes" limit="10" paginated="no"/}}
13 +)))|=(((
41 41  = Nyeste sider =
42 42  
43 43  {{velocity}}
44 -#set ($hql = "select doc.fullName from XWikiDocument doc where doc.hidden = false and doc.fullName not in (select obj.name from BaseObject obj where obj.className = 'Blog.BlogPostClass') order by doc.creationDate desc")
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 +")
28 +
45 45  #set ($query = $services.query.hql($hql))
46 46  #set ($discard = $query.setLimit(500))
47 47  #set ($pages = $query.execute())
48 48  #set ($count = 0)
49 -##
33 +
50 50  (% class="recent-pages" %)
51 -|=Page|=Created
52 -#foreach ($pageName in $pages)##
53 -#if ($count < 10)##
54 -#set ($canView = $xwiki.hasAccessLevel('view', $context.user, $pageName))##
55 -#if ($canView)##
56 -#set ($tags = $services.tag.getTagsForDocument($pageName))##
57 -#if (!$tags.contains('noshow'))##
58 -#set ($page = $xwiki.getDocument($pageName))##
59 -|[[${page.title}>>${page.fullName}]]|$datetool.format('dd-MM-yyyy', $page.creationDate)
60 -#set ($count = $count + 1)##
61 -#end##
62 -#end##
63 -#end##
64 -#end##
35 +#foreach ($pageName in $pages)
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
52 + #end
53 +#end
65 65  {{/velocity}}
66 66  
67 -)))
68 -{{/container}}
56 +
69 69  
70 70  )))
71 71