Hi All
There are only a few (5) items displayed with the Favourite Pages Macro in Confluence.With Edit no parameters can be changed.
How can we change the number of items to be displayed with the Favourite Pages Macro?
Thxs and cheers, Manfred.
Hi Manfred,
you can't change the number of items to display, but you can add your own favorite pages user macro for that purpose:
(if you don't know, how to create a user macro, look at my article for an example)
This example is using code provided by @Davin Studer from the answer: https://community.atlassian.com/t5/Confluence-questions/Can-I-view-all-of-my-favorite-pages/qaq-p/327833
I've changed his example, so you can add a parameter for the number of items to display. And here is the code:
## Developed by: Davin Studer## Enhanced with parameter NumberOfFavorites by Thomas Schlegel## Date created: 06/10/2013, Date enhance: 03/08/2017## @param NumberOfFavorites:title=Number of favorites to show pagecount|type=int|desc=Number of favourite pages to show|default=5#set( $labelManager = $action.LabelManager )#set( $favRef = $labelManager.getLabel("my:favourite") )#set ($Integer = 0)#set ($paramNumberOfFavorites = $Integer.parseInt($paramNumberOfFavorites))#if ($favRef) #set( $favorites = $labelManager.getCurrentContentForLabel( $favRef ) ) #set( $counter = 1) #if ($favorites.size() > 0) <ul> #foreach( $favorite in $favorites ) #if ( $favorite.getType() == "page" ) #if ($counter <= $paramNumberOfFavorites) <a href="$favorite.UrlPath">$favorite.DisplayTitle</a><br/> #set ($counter = $counter + 1) #end #end #end </ul> #end#end
Hi Thomas and thxs very much for your prompt answer!
You're welcome :-)
If you think, your question is answered, please mark it as answered so other users can find answered questions more easy.
Thank you.
thxs for the hintI think this answers my question, although I won't apply it for the moment on the page I have the actual macro.
Possibly will try it first on anothter test page.
Cheers
It looks like you're new here. Sign in or register to get started.