Can I view all of my favorite pages?
Asked by Paul LaBarbera:

The "Favorite Pages" macro no longer lists all of your favorite pages. It only shows "recently added" favorites.

I'm looking for a small user macro that provides a simple list of ALL of the current users favorite pages (for a dashboard).

Anyone been successful with this?


Answers:
author: Davin Studer
body: You can create a user macro for this.

```
## Developed by: Davin Studer## Date created: 06/10/2013## @noparams#set( $labelManager = $action.LabelManager )#set( $favRef = $labelManager.getLabel("my:favourite") )#set( $favorites = $labelManager.getCurrentContentForLabel( $favRef ) )&lt;ul&gt;#foreach( $favorite in $favorites )    #if ( $favorite.getType() == "page" )        &lt;li&gt;&lt;a href="$favorite.UrlPath"&gt;$favorite.DisplayTitle&lt;/a&gt;&lt;/li&gt;    #end#end&lt;/ul&gt;
```

**Update:**

This should get rid of the error if there are no favorites.

```
## Developed by: Davin Studer## Date created: 06/10/2013## @noparams#set( $labelManager = $action.LabelManager )#set( $favRef = $labelManager.getLabel("my:favourite") )#if($favRef)    #set( $favorites = $labelManager.getCurrentContentForLabel( $favRef ) )    #if($favorites.size() &gt; 0)        &lt;ul&gt;        #foreach( $favorite in $favorites )            #if ( $favorite.getType() == "page" )            &lt;li&gt;&lt;a href="$favorite.UrlPath"&gt;$favorite.DisplayTitle&lt;/a&gt;&lt;/li&gt;            #end        #end        &lt;/ul&gt;    #end#end
```

comments: author: Paul LaBarbera
body: Thank you! That macro is exactly what I wanted.


author: Paul LaBarbera
body: Thanks @Davin Studer ! I'm running into a problem wtih that macro. It works great for me, but for users that don't have any favorites... it causes a page error. I don't know how to write macros very well....Would adding someting likeif $favorites = 0 \<p\>You have no favorites yet\</p\>elseif ....your orignal list aggregatorwork?


author: Davin Studer
body: See my edit above.


author: Daniel Fu?
body: Hey [@Davin Studer](/t5/user/viewprofilepage/user-id/1018164),

thanks for this solution.

Im creating a custom list of spaces and im searching for a solution to add a space to the favorites.

For browsing to the specific space i have used

```
<a class="icon icon-browse-space" href="/spaces/browsespace.action?key=$!space.key" title="Browse Space">Browse the "$!space.key" space</a>

```

To add a space to the favorites its more difficult i think.

There is no href you could use for.

href is ".../#"

Do you have an idea for that, too?

Thanks \& Regards

Daniel


author: T. Brian Jones
body: Simplest solution I've found is to use a "Content by Label" macro and use the *secret* label name of \`my:favourite\` that automatically gets assigned to content you favorite.

![Screen Shot 2018-05-02 at 3.25.59 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/21191iCC0DCF5FDCE1FEEF/image-size/large?v=v2&px=999 "Screen Shot 2018-05-02 at 3.25.59 PM.png")

comments: author: Davin Studer
body: Great idea!


author: Kevin Suter
body: Hi Brian,

This solution works and is really helpful because you can use other filters too. Thanks a lot.

Cheers,  
Kevin


author: Alexander Wirtz
body: Thx Brian, that was an easy way!


author: Deividi Luvison
body: Hey Paul,

I tried to search around our marketplace repository and I was unable to find a plugin/user macro to achieve that end.

I know is not a short term solution however I created below feature request to check if its feasible to implement a option to display all favorite in the favorite pages macro:

<https://jira.atlassian.com/browse/CONF-35437>

Make sure to vote for that bug and mark yourself as a watcher for future updates.  
Thanks and Regards,  
David\|Confluence Support Engineer

comments: author: Paul LaBarbera
body: Thanks David.@William Zanchet \[Atlassian\] , this response is in line with the problem I'm having. Our dashboard has a macro on it that shows the current users favorite pages. After upgrading to 5.6, it only showed "recently added" favorites.


author: Jean-Christophe Gonzales
body: with Confluence 7.8.1, Server : this facility exits :

![2021-01-27 16_31_09-Jean-christophe GONZALES - Preferences - DSIA Confluence.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/127629i320E8BB9073D1A20/image-dimensions/386x392?v=v2 "2021-01-27 16_31_09-Jean-christophe GONZALES - Preferences - DSIA Confluence.jpg")

...for display usage only, not for a macro, but someone can find this trick usefull


author: Vadim Rutkevich
body: Hi Paul,

please take a look at our app [Favorite Pages](https://marketplace.atlassian.com/plugins/com.stiltsoft.confluence.favoritepages/server/overview). This app tracks all your page visits within the defined time period and then displays a list of your top visited pages and set hotkeys for their quick access. Here you can also view the list of pages saved for later and proceed to their editing.

Thanks.

Best Regards,

Vadim Rutkevich \[StiltSoft\]


Tags: confluence-administration