Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I list all Likes for a page?

Dave Horn September 10, 2017

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

4 votes
Answer accepted
Jeremy M
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 11, 2017

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
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 11, 2017

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

Jeremy M
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 11, 2017

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

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 11, 2017

Jeremy,

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

Kind Regards,
Shannon

Dave Horn September 11, 2017

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

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 12, 2017

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
TAGS
AUG Leaders

Atlassian Community Events