Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Reverse the order in which comments appear

Eric April 4, 2017

I tried the scripts here: https://community.atlassian.com/t5/Confluence-questions/Is-it-possible-to-reverse-the-order-in-which-comments-appear/qaq-p/21425

 

But the thread is 5 years old and the scripts don't seem work on more recent versions (I am running 5.8.6)

 

When I put the code in the end of Head Custom HTML, the code appears at the top of every wiki page in an error state, and doesn't render.

2 answers

2 votes
Panos
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.
April 4, 2017

That part of the answer worked perfectly on my instance 5.8.10

<script>
function reverseCommentOrder(){
  $comments = AJS.$('#page-comments'); 
  $comments.children().each(function(i,li){$comments.prepend(li)});
}

AJS.toInit(function(){

  reverseCommentOrder();
});
</script>

(I added the script tags self as you should do, otherwise the code will appear in the page). If that doesnt work, please provide the error state/error message

Paul Willman April 5, 2017

I was unable to locate the custom html file anywhere on my PC - searching for Confluence Admin yielded naught.  This is a client-side file, correct?  Where can I find it?

Sloan N_ B_
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.
August 20, 2018

@Panos Perfect, I looked for something like this.

@Paul Willman No, you find it in the Confluence application:

Go as logged in user with admin permission to General Configuration > Look and Feel > Custom HTML

Click edit and add the Script at At end of the HEAD.

Cheers
Niklas

0 votes
Jen May 4, 2017

We are not using html code, is there a way to do this without the code?

 

If I enter just this code, where do I put it?  

Dolby Enterprise Apps September 27, 2017

Any update

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events