Modifications pour le document Nuage de tags
Modifié par superadmin le 2021/12/12 21:56
modifié par Administrator
sur 2013/06/04 10:05
sur 2013/06/04 10:05
modifié par Paul Libbrecht (admin)
sur 2019/10/13 16:51
sur 2019/10/13 16:51
Commentaire de modification :
Migrated property [contentJavaType] from class [XWiki.WikiMacroClass]
Résumé
Détails
- Propriétés de la Page
-
- Auteur du document
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. Admin1 +XWiki.adminPolx
- XWiki.StyleSheetExtension[0]
-
- Code
-
... ... @@ -2,6 +2,7 @@ 2 2 text-align: justify; 3 3 /* Overriding of toucan value */ 4 4 margin: 0; 5 + padding: 0; 5 5 } 6 6 7 7 div#dashboardleft ol.tagCloud {
- XWiki.WikiMacroClass[0]
-
- Code de la macro
-
... ... @@ -1,7 +1,8 @@ 1 1 {{velocity}} 2 2 ## 3 3 ## tagCloudSpace - the space to display the tag cloud for. If blank, display cloud for the whole wiki. Default is blank. 4 -#set ($tagCloudSpace = $context.macro.params.get('space')) 4 +#set ($tagCloudSpace = $xcontext.macro.params.get('space')) 5 +#set ($tagCloudSpaces = $xcontext.macro.params.get('spaces')) 5 5 ## 6 6 ## Configurable popularity levels. You must enter an even number of levels. Default: 6. 7 7 #set ($popularityLevels = ["notPopular", "notVeryPopular", "somewhatPopular", "popular", "veryPopular", "ultraPopular"]) ... ... @@ -9,8 +9,22 @@ 9 9 ## 10 10 $xwiki.ssx.use('XWiki.TagCloud')## 11 11 ## 12 -## Get tag count map. Key: tag, value: number of occurrences. 13 -#set ($tagCount = $xwiki.tag.getTagCount("$!tagCloudSpace")) 13 +#if( $tagCloudSpace && $tagCloudSpaces ) 14 + {{error}} 15 + ##Do not use space and spaces parameter in the same time. 16 + {{translation key="xe.tag.paramerror" /}} 17 + {{/error}} 18 + #break 19 +#end 20 + 21 +##If multiple spaces with "spaces" parameter 22 +#if( $tagCloudSpaces ) 23 + #set ($tagCount = $xwiki.tag.getTagCountForSpaces($tagCloudSpaces)) 24 +#else 25 + ##If only one space 26 + ## Get tag count map. Key: tag, value: number of occurrences. 27 + #set ($tagCount = $xwiki.tag.getTagCount("$!tagCloudSpace")) 28 +#end 14 14 ## 15 15 ## Only build popularity map if at least one tag exists 16 16 #if ($tagCount.size() > 0) ... ... @@ -18,8 +18,8 @@ 18 18 ## Store the minimum and maximum number of occurrences. 19 19 #set ($sortedTagCounts = $sorttool.sort($tagCount.values())) 20 20 #set ($maxIndex = $sortedTagCounts.size() - 1) 21 - #set ($minCount = $ listtool.get($sortedTagCounts,0))22 - #set ($maxCount = $ listtool.get($sortedTagCounts,$maxIndex))36 + #set ($minCount = $sortedTagCounts[0]) 37 + #set ($maxCount = $sortedTagCounts[$maxIndex]) 23 23 ## 24 24 ## Calculate the total number of tags in the wiki. 25 25 #set ($totalTagNumber = 0)
- XWiki.WikiMacroParameterClass[1]
-
- Description du paramètre
-
... ... @@ -1,0 +1,2 @@ 1 +Spaces to display the tag cloud for. Spaces name must be separate by "," character and "'". 2 +(i.e. spaces="'My Space','Space2'") - Paramètre obligatoire
-
... ... @@ -1,0 +1,1 @@ 1 +Non - Nom du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +spaces