Feature Request: Order Article Attachments

10 Comments

  • Kristina Tibbitts

    This would be extremely helpful!

    0
  • Yoshiko Matsuo

    I request the same feature

    0
  • Conny Svanberg

    Exactly what I am looking for right now...

    0
  • Adam Ashby-Clarke

    Came here looking for this exact same thing.  Weirdly they are organised when I edit the article, by name, which is fine since we use version numbers, but on the article that is published they appear random...

    1
  • Holly Jania

    We would like this as well!

    1
  • Christophe Tiraboschi
    Zendesk Customer Care

    Hi Everyone,

    As a workaround, here is a piece of Javascript to order attachements by alphabetical order on the front-end of an article:

    const reorder = () => {
    const frag = document.createDocumentFragment();
    const list = document.querySelector(".attachments");
    const items = list.querySelectorAll("li");
    const sortedList = [...items].sort((a, b) => {
    const c = a.textContent,
    d = b.textContent;
    return c < d ? -1 : c > d ? 1 : 0;
    });
    for (const item of sortedList) {
    frag.appendChild(item);
    }
    list.appendChild(frag);
    }

    reorder()

    You can use this code in the script.js file of your theme, ideally just before the last closing bracket.

    If you have a custom theme, please double check that the <ul> tag listing the attachements has still the class "attachements". You can find it in the article_page.hbs file at the line 96 in the default theme (see screenshot attached). If the name of the class was changed, you would need to adjust the third line of the snippet provided above by replacing "attachements" with the new class name.

    0
  • Conny Svanberg

    Thanks a lot, Christophe!

    Made my life a lot more easy to live... :-)

    0
  • Adam Ashby-Clarke

    Hi Christophe Tiraboschi,

    Thanks for this, I have tried adding this as it has been very frustrating not having it, however it has not changed the article, they are still ordered incorrectly.  Please advise what I can check?  Using the default Copenhagen theme.  This is the bottom of my script.js.

    And this is my article page where you will see they are still in a different order (ive blocked the first part of the filename, but it is identical), the only difference is the version number at the end, im wondering does your workaround apply to numbers also?

    0
  • Laura Benison

    hi Christophe Tiraboschi

    thank you for sending this but for my particular role, it would really be helpful to be able to manually re-order the articles in order of importance. right now, when we receive a new version of an important document that should be listed at the top of the documents section, i have to delete all the documents and then re-upload the document in the order of importance. 

    0
  • Katarzyna Karpinska
    Zendesk Product Manager

    Hi All, 

    Thank you for your comments and feedback. It's highly appreciated, especially since we are planning to spend some time in the next two quarters bringing some improvements into the area of article attachment management. 

    1

Please sign in to leave a comment.

Powered by Zendesk