Hi, I want to change Confluence Usage Stats plugin to display all projects in the confluence on the "Global Activity" section so I tried to overwrite the plugin. Now I can change the number of spaces by setting "max" parameter, but I need to the total project(or space) count to "max" parameter. How can get the total space count and use it? It can be like this:
#set ($spaceCount = "display=count|spaces=@all") $helper.renderConfluenceMacro("{popular:display=icon,count|max=$spaceCount|type=spaces|$commonParams}")
Community moderators have prevented the ability to post new answers.
#set ($spaceCount = 0) #foreach ($space in $spaceManager.getAllSpaces()) #set ($spaceCount = $spaceCount + 1) #end<br />
It gets easier than that.
$spaceManager.getAllSpaces().size()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The above code is for a user macro. Go to Confluence Admin -> User Macros to create one. After you create the user macro it will show up in your macro browsers. Below are some links for how to create user macros. https://confluence.atlassian.com/doc/user-macro-template-syntax-223906130.html https://developer.atlassian.com/confdev/development-resources/confluence-architecture/confluence-internals/velocity-template-overview/confluence-objects-accessible-from-velocity
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.