Number of items in Favourite Pages Macro

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.

1 answer

1 accepted

0 votes
Accepted answer
Thomas Schlegel Community Champion Aug 03, 2017

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:

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)
#foreach( $favorite in $favorites )
#if ( $favorite.getType() == "page" )
#if ($counter <= $paramNumberOfFavorites)
<a href="$favorite.UrlPath">$favorite.DisplayTitle</a><br/>
#set ($counter = $counter + 1)

Hi Thomas and thxs very much for your prompt answer!

Thomas Schlegel Community Champion Aug 04, 2017

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 hint
I 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.


Hi Thomas!

I want to "pimp" your script, e.g. the display of the spaces like the build-in macro, but I don't found a list of the methodes (like the .UrlPath or .DisplayTitle) of the Confluence API.

Does you have a link for me?

Greetings from OWL to HH!


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

503 views 3 18
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you