How can I list all Likes for a page?

I have asked staff to Like a page. It has over 100 Likes, but when I click the 'Others' link it pops up a modal window listing only 50 users.

What setting do I change to show all users who have Liked a page when the 'Others' link is clicked? Is there another way to retreive this complete list?

2 answers

1 accepted

3 votes
Accepted answer

Dear Dave,

You can create a user macro for this. The following will calculate how many likes a given page has received. You should grab the page ID for it to work.

## Macro name: Pagelikes
## Visibility: Visible to all users in the Macro Browser
## Macro title: Page Likes
## Description: Toont het aantal pagelikes voor een opgegeven pagina.
## Categories: Confluence content
## Macro body processing: No macro body
##
## Developed by: Jeremy Mooiman
## Date created: 11.09.2017
## Installed by: Jeremy Mooiman
## @param PageID:title=Page ID|type=int|required=false|desc=ID of page to count likes
##
## Check for page id parameter, otherwise use default of current page
#if (!$paramPageID)
#set ($paramPageID=$content.id)
#end
##
#set( $containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager') )
#set( $getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null) )
#set( $containerManager=$getInstanceMethod.invoke(null,null) )
#set( $containerContext=$containerManager.containerContext )
#set( $pageManager=$containerContext.getComponent('pageManager') )
#set( $likeManager=$containerContext.getComponent('likeManager') )
##
#set ($targetPage = $action.page)
## Set up integer object to handle string conversion of page id
#set($Integer = 0)
##
#if ($pageManager)
#set ($targetPage = $pageManager.getPage($Integer.parseInt($paramPageID)))
#end
##
#set($count = $likeManager.countLikes($targetPage))
#if ($likeManager)
<table class="confluenceTable tablesorter tablesorter-default stickyTableHeaders" role="grid" style="padding: 0px;"><colgroup><col><col></colgroup><thead class="tableFloatingHeaderOriginal"><tr role="row" class="tablesorter-headerRow"><th class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="0" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Page: No sort applied, activate to apply an ascending sort"><div class="tablesorter-header-inner">Page</div></th><th class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="1" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Likes: No sort applied, activate to apply an ascending sort"><div class="tablesorter-header-inner">Likes</div></th></tr></thead><thead class="tableFloatingHeader" style="display: none;"><tr role="row" class="tablesorter-headerRow"><th class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="0" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Page: No sort applied, activate to apply an ascending sort"><div class="tablesorter-header-inner">Page</div></th><th class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="1" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Likes: No sort applied, activate to apply an ascending sort"><div class="tablesorter-header-inner">Likes</div></th></tr></thead><tbody aria-live="polite" aria-relevant="all"><tr role="row"><td class="confluenceTd">$content.title</td><td class="confluenceTd"><span class="likecount">$count</span></td></tr></tbody></table>
#end

This is how can you find the ID of a page;

https://confluence.atlassian.com/confkb/how-to-get-confluence-page-id-648380445.html

Friendly Regards,

Jeremy Mooiman

http://www.prepend.nl

1 vote

Hi Dave,

To jump onto Jeremy's suggestion to use a macro, we have a suggestion for this if you could vote on it to show your support to show more than 50 likes:

@Jeremy Mooiman - feel free to share your workaround on the feature request!

Kind Regards,
Shannon

Dear Shannon,

It will require quite some tinkering to perfect it. And it will obviously be quite a hassle for people who are not directly into programming. I will vote on your feature request. In the meantime people can use the macro.

Should you want anything added; please let me know.

Friendly Regards,

Jeremy Mooiman

Jeremy,

No worries! Thank you for letting us know! Glad to at least have a workaround in the time being.

Kind Regards,
Shannon

Thanks Shannon, Jeremy. I've voted on the issue. The macro looks daunting but I've kicked it over to our IT Services team, see if they can work with it :)

Cheers, Dave

Great! Thanks for letting us know. Dave! :) 

Take care and do let us know if you have any trouble.

Kind Regards,
Shannon

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

68 views 3 2
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