Changes for page Tag Cloud
Last modified by Tobias Wintrich on 2025/06/04 09:20
From version 4.1
edited by Tobias Wintrich
on 2023/03/20 11:07
on 2023/03/20 11:07
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-tag-ui/15.1]
To version 7.1
edited by Tobias Wintrich
on 2025/06/04 09:20
on 2025/06/04 09:20
Change comment:
Migrated property [featureMandatory] from class [XWiki.WikiMacroParameterClass]
Summary
-
Objects (1 modified, 0 added, 0 removed)
Details
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -4,6 +4,9 @@ 4 4 #set ($tagCloudSpace = $xcontext.macro.params.get('space')) 5 5 #set ($tagCloudSpaces = $xcontext.macro.params.get('spaces')) 6 6 #set ($limit = $xcontext.macro.params.get('limit')) 7 +#if ("$!limit" != '' && $limit < 0) 8 + #set ($limit = 0) 9 +#end 7 7 ## 8 8 ## Configurable popularity levels. You must enter an even number of levels. Default: 6. 9 9 #set ($popularityLevels = ["notPopular", "notVeryPopular", "somewhatPopular", "popular", "veryPopular", "ultraPopular"]) ... ... @@ -39,7 +39,7 @@ 39 39 ## If tags have the same occurrence, limit them in alphabetical order 40 40 #set ($tagCountListSorted = $collectiontool.sort($tagCountList, ['count:desc', 'name'])) 41 41 #if ("$!limit" != '') 42 - #set ($tagCountListSorted = $tagCountListSorted.subList(0, $limit)) 45 + #set ($tagCountListSorted = $tagCountListSorted.subList(0, $mathtool.min($tagCountListSorted.size(), $limit))) 43 43 #end 44 44 ## 45 45 ## Only build popularity map if at least one tag exists