Wiki source code of Makro: Verwandte Themen (automatisch)
Last modified by Dimitri Rupp on 2026/06/11 08:40
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
![]() |
1.1 | 1 | {{velocity}} |
| 2 | #set($ownTags = $xwiki.tag.getTagsFromDocument($doc.fullName)) | ||
![]() |
2.1 | 3 | #if("$!ownTags" != "" && $ownTags.size() > 0) |
![]() |
1.1 | 4 | #set($scores = {}) |
| 5 | #foreach($t in $ownTags) | ||
![]() |
2.1 | 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)) | ||
![]() |
1.1 | 12 | #end |
![]() |
2.1 | 13 | #end |
| 14 | #end | ||
| 15 | #end | ||
![]() |
1.1 | 16 | #if($scores.size() > 0) |
![]() |
2.1 | 17 | #set($tagList = $stringtool.join($ownTags, ", ")) |
| 18 | //Automatisch vorgeschlagen über gemeinsame Tags ($tagList):// | ||
![]() |
1.1 | 19 | |
| 20 | #set($shown = 0) | ||
![]() |
2.1 | 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) | ||
![]() |
1.1 | 26 | #end |
| 27 | #end | ||
| 28 | #end | ||
![]() |
2.1 | 29 | #end |
| 30 | #end | ||
![]() |
1.1 | 31 | {{/velocity}} |
