We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6102
    • 17 Posts
    Is there any way to change the Modx Manager default tree sort.
    It currently defaults to sort by Document number.
    I would like to change it to Menu I.D. Ascending?

    This will eliminate a step for my end users that need to
    see the tree as it appears on the website.

    CTUSA
      • 18397
      • 3,250 Posts
      I think this used to be in the bugtracker, if it is nolonger there feel free to file a feature request for it as many of us would like that.
        • 13736
        • 345 Posts
        I was wondering if this default sorting option was ever worked on? I have been wanting my default sorting to be ID-Ascending ever since I started playing around in MODx (I think version 0.9.1)



          • 25663 MODX Staff
          • 12,272 Posts
          It’s that way in 097 already, but for 096 it’s the status quo ... feel free to hack away. :/
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 19843
            • 13 Posts
            Is there anyway to set the menu tree sort to menu id ascending by default? It is confusing to my editors.

            Thanks
              • 6726
              • 7,075 Posts
              The file you want to hack is [tt]manager/frames/tree.php[/tt]
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l'outil id
                • 19843
                • 13 Posts
                Could anyone explain how to set the default in the file manager/frames/tree.php or provide the code needed that I can copy/paste? I don’t know enough about php coding to do this grin and I wouldn’t want to mess up the script.

                Thanks
                  • 13736
                  • 345 Posts
                  I too would like to know where it’s getting the default values. Currently it is defaulting to the first items in the dropdown list, but I tried simply moving the sort menu items around in that selector form, and it didn’t seem to matter. Instead the default items changed to second or third items in the list.

                  I would like to have the default values as:

                  tree_sortby == menuindex
                  tree_sortdir == ASC

                  I just can’t figure out where it’s setting those at first login.

                    • 22303 MODX Staff
                    • 10,725 Posts
                    This is done in trunk. You can see the diff here, lines 74 to 82.
                      • 13736
                      • 345 Posts
                      Ok. So it’s in manager/frames/nodes.php instead of manager/frames/tree.php (v0.9.6)

                      And I just needed to change line 75 from:

                              $orderby = "isfolder DESC";

                      to
                              $orderby = "menuindex ASC";


                      and possibly the same values in lines 79 and 80. But it seems to work without changing those at the moment. I’m not sure what those lines 79 & 80 are for.