Hello.
I hope to get the recent updated contents information with their labels.
Just like this Atlassian Answers's top page.
This is because "Recent update macro" does not display labels of each pages, so it 's not easy for users to understand the content information only with its page title.
Any ideas, including plugin informations are appreciated.
Hi,
Not sure if there is a macro to do that (probably is), but it is quite easy to achieve with a simple user macro (https://confluence.atlassian.com/display/DOC/Writing+User+Macros)
Something like this to start with:
## Macro title: Recent Pages ## Macro has a body: N ## ## Developed by: Vertuna llc ## Date created: 26/11/2014 ## This is an example macro ## @param Space:title=Space key|type=string|required=true|desc=Space key #set ($pages = ${pageManager.getRecentlyUpdatedPages(5, $paramSpace)}) #foreach ($p in $pages) <h3><a href="$p.urlPath">$p.displayTitle</a></h3> #foreach ($l in $p.labellings) <a class="aui-label" href="$l.label.urlPath">$l.label.name</a> #end #end
There is a limit of 5 set to getRecentlyUpdatedPages method, you can change it to anything you like, or make it parametrisable if needed.
Hi, Sash, thanks for the answer and taking your time! Since I want to get the recent update contents of all the spaces, then I changed the $paramSpace to 'null'. If I am allowed to ask for more, I wish "Show More" link is enabled, which allows users to see older pages/news/blogposts. Also, it seems "favorite" labels which added by current user are included in the results, I hope to exclude "favorite" labels. (Maybe this is not so difficult.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, to look for all spaces 'null' should be used as a parameter to getRecentlyUpdatedPages method, according to https://docs.atlassian.com/confluence/latest/com/atlassian/confluence/pages/PageManager.html#getRecentlyUpdatedPages(int, java.lang.String) As for "Show More" link.. it does depends on how you would need to implement it. If just a link that shows already rendered pages list then it is doable using the UserMacro with not so much effort, but if you need this to be dynamically loaded then you probably would go with a "normal" custom confluence macro and how something as rest endpoint defined to load "next" page of pages (unless there is a rest api already to do that) "favorite" labels you can just exclude by name from showing, as user "favourite" is just a label with this "constant name", see more about labels: https://docs.atlassian.com/confluence/latest/com/atlassian/confluence/labels/Labelling.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.