Can I view all of my favorite pages?

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?

3 answers

1 accepted

3 votes
Davin Studer Community Champion Oct 29, 2014

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 ) )
<ul>
#foreach( $favorite in $favorites )
    #if ( $favorite.getType() == "page" )
        <li><a href="$favorite.UrlPath">$favorite.DisplayTitle</a></li>
    #end
#end
</ul>

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() > 0)
        <ul>
        #foreach( $favorite in $favorites )
            #if ( $favorite.getType() == "page" )
            <li><a href="$favorite.UrlPath">$favorite.DisplayTitle</a></li>
            #end
        #end
        </ul>
    #end
#end

Thank you! That macro is exactly what I wanted.

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 like if $favorites = 0 <p>You have no favorites yet</p> elseif ....your orignal list aggregator work?

Davin Studer Community Champion Oct 31, 2014

See my edit above.

Hey @Davin Studer,

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

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

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.

Hi Paul,

please take a look at our app Favorite Pages. 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]

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,792 views 26 10
Join discussion

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