Last modified by Dimitri Rupp on 2026/06/11 08:40

From version 2.1
edited by Dimitri Rupp
on 2026/06/11 08:40
Change comment: There is no comment for this version
To version 1.1
edited by Dimitri Rupp
on 2026/06/11 08:39
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,31 +1,31 @@
1 1  {{velocity}}
2 2  #set($ownTags = $xwiki.tag.getTagsFromDocument($doc.fullName))
3 -#if("$!ownTags" != "" && $ownTags.size() > 0)
3 +#if($ownTags && $ownTags.size() > 0)
4 4  #set($scores = {})
5 5  #foreach($t in $ownTags)
6 -#foreach($d in $xwiki.tag.getDocumentsWithTag($t))
7 -#if($d != $doc.fullName && !$d.startsWith('IT-Wiki.Vorlagen') && !$d.startsWith('IT-Wiki.Makros') && !$d.startsWith('Sandbox'))
8 -#if($scores.containsKey($d))
9 -#set($void = $scores.put($d, $scores.get($d) + 1))
10 -#else
11 -#set($void = $scores.put($d, 1))
6 + #foreach($d in $xwiki.tag.getDocumentsWithTag($t))
7 + #if($d != $doc.fullName && !$d.startsWith('IT-Wiki.Vorlagen') && !$d.startsWith('IT-Wiki.Makros'))
8 + #if($scores.containsKey($d))
9 + #set($void = $scores.put($d, $mathtool.add($scores.get($d), 1)))
10 + #else
11 + #set($void = $scores.put($d, 1))
12 + #end
13 + #end
14 + #end
12 12  #end
13 -#end
14 -#end
15 -#end
16 16  #if($scores.size() > 0)
17 -#set($tagList = $stringtool.join($ownTags, ", "))
18 -//Automatisch vorgeschlagen über gemeinsame Tags ($tagList)://
17 +//Automatisch vorgeschlagen (gemeinsame Tags: #foreach($t in $ownTags)##$t## #end)://
19 19  
20 20  #set($shown = 0)
21 -#foreach($minScore in [4, 3, 2, 1])
22 -#foreach($entry in $scores.entrySet())
23 -#if($entry.value == $minScore && $shown < 6)
24 -* [[$xwiki.getDocument($entry.key).plainTitle>>doc:$entry.key]]
25 -#set($shown = $shown + 1)
20 +#foreach($minScore in [3, 2, 1])
21 + #foreach($entry in $scores.entrySet())
22 + #if($entry.value == $minScore && $shown < 6)
23 + #set($rdoc = $xwiki.getDocument($entry.key))
24 + * [[$rdoc.plainTitle>>doc:$entry.key]]
25 + #set($shown = $mathtool.add($shown, 1))
26 + #end
27 + #end
26 26  #end
27 27  #end
28 28  #end
29 -#end
30 -#end
31 31  {{/velocity}}