Reversing the default sort order of article lists in the Help Center

7 Comments

  • Larisa Moore

    We haven't migrated from Web Portal to Help Center yet, but are looking into it. We typically sort our articles either by "Most viewed" or by "Highlighted, then latest activity." Are either of these options available in the new Help Center? (I'm guessing Promoted articles float to the top like Highlighted articles do, but what about sorting by Most Viewed?)

    0
  • Sean LaRussa

    Unfortunately this also puts the promoted articles on the bottom of the list.  Can this be modified to keep the promoted articles on top?

    0
  • Matt Zaglin

    +1 for the ability to bump promoted articles up, despite their age.

    0
  • Charles Nadeau

    Sean and Matt: I modified the script slightly so that promoted articles stay on top.

     

    0
  • Sean LaRussa

    Thanks Charles!  That is exactly what I was looking for.

    0
  • Matt Frowe

    Hi Charles et al,

    I realise I'm hijacking a slightly old thread here, but I was hoping you could help with a question. I adapted your code above to reverse the default sort order of article comments, to be newest first. The code I ended up with was:

    //Reverse order of comments

    function reverseCommentOrder() {
    var lists = document.getElementsByClassName('comment-list');
    for (var i = 0; i < lists.length; ++i) {
    var comments = lists[i];
    var j = comments.childNodes.length;
    while (j--) {

    comments.appendChild(comments.childNodes[j]);

    }
    }
    }

    window.addEventListener('load', reverseCommentOrder, false);

     

    This works fine, until there are a sufficient number of comments that pagination gets introduced. Then, predictably, it changes the sort order per page rather than for the whole list. So, my question is, do you know if there's a way to apply the javascript pre-pagination so that the whole list is sorted and then paginated?

    Thanks for any assistance you can provide.

    Matt

    1
  • Erik Haan

    Is it possible to write a script for Help Center articles to be ordered from most viewed to least viewed?

    2

Please sign in to leave a comment.

Powered by Zendesk