Depuis la version 1.1 >
modifié par Administrator
sur 2013/06/04 10:05
À la version < 7.1
modifié par superadmin
sur 2021/12/12 21:56
Commentaire de modification : Install extension [org.xwiki.platform:xwiki-platform-tag-ui/13.10]

Résumé

Détails

Icon Propriétés de la Page
Auteur du document
... ... @@ -1,1 +1,1 @@
1 -XWiki.Admin
1 +XWiki.superadmin
Icon 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 {
Icon 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,17 +9,31 @@
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)
17 17   ##
18 18   ## Store the minimum and maximum number of occurrences.
19 - #set ($sortedTagCounts = $sorttool.sort($tagCount.values()))
34 + #set ($sortedTagCounts = $collectiontool.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)
... ... @@ -33,12 +33,12 @@
33 33   #set ($secondHalfIntervalSize = $mathtool.div($mathtool.sub($maxCount, $countAverage), $levelsHalf))
34 34   ##
35 35   ## Use a sorted map
36 - #set ($popularityMap = $collectionstool.getSortedMap())
51 + #set ($popularityMap = $collectiontool.sortedMap)
37 37   #set ($previousPopularityMax = $minCount)
38 38   #set ($intervalSize = $firstHalfIntervalSize)
39 39   #set ($halfPassed = false)
40 40   #foreach ($popularityLevel in $popularityLevels)
41 - #if ($velocityCount > $levelsHalf && !$halfPassed)
56 + #if ($foreach.count > $levelsHalf && !$halfPassed)
42 42   #set ($intervalSize = $secondHalfIntervalSize)
43 43   #set ($halfPassed = true)
44 44   #end
... ... @@ -63,7 +63,7 @@
63 63   #end
64 64   #end
65 65   <li class="$liClass">
66 - <a class="tag" href="$xwiki.getURL('Main.Tags', 'view', "do=viewTag&amp;tag=$escapetool.url($tagEntry.Key)")" title="$services.localization.render('xe.tag.tooltip', ["$tagEntry.Value"])">$escapetool.xml($tagEntry.Key)</a>
81 + <a class="tag" href="$xwiki.getURL('Main.Tags', 'view', "do=viewTag&amp;tag=$escapetool.url($tagEntry.Key)")" title="$services.localization.render('xe.tag.tooltip', [$tagEntry.Value])">$escapetool.xml($tagEntry.Key)</a>
67 67   </li>
68 68   #end
69 69   </ol>
Icon 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
This wiki is licensed under a Creative Commons 2.0 license
XWiki 13.10 - Documentation - Conditions