We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24495
    • 407 Posts
    Is there a way to "save" the sorting order of the document tree in manager view? Anytime when I log in I must first again sort the document tree because my requirement is "sorted by menuindex".
    Is there a way or can it be included in further versions of modx maybe in configuration settings?
      • 24495
      • 407 Posts
      Is there another thread to this question or am I alone with this?
        • 25663 MODX Staff
        • 12,272 Posts
        No ... that’s not currently possible but would be handy indeed. (I don’t think it’s possible, anyway.)
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 11975
          • 2,542 Posts
          Hi,

          Not sure about it but have a look to this file => manager/frames/nodes.php around line 73
          In makeHTML function
          the default params are set by these lines

          <?php
          
          // query other documents, set default sort order
                  $orderby = "isfolder DESC";//here
                  if(isset($_SESSION['tree_sortby']) && isset($_SESSION['tree_sortdir'])) {
                      $orderby = $_SESSION['tree_sortby']." ".$_SESSION['tree_sortdir'];
                  } else {
                      $_SESSION['tree_sortby'] = 'isfolder';//here
                      $_SESSION['tree_sortdir'] = 'DESC';//here
                  }
          



          :-)
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 24495
            • 407 Posts
            Tried modifying: undecided
            "isfolder" to "menuindex"
            "DESC" to "ASC"

            and ... it works! laugh

            Thx for the tip. And now: please give us a parameter in manager configuration to set ordering as personal default.
              • 13481
              • 97 Posts
              I agree, a parameter would be handy indeed. And thanks for the tip! laugh

              Thanks,

              James
                • 13667
                • 3 Posts
                hi all

                Quote from: heliotrope at Feb 28, 2007, 06:34 PM

                Not sure about it but have a look to this file => manager/frames/nodes.php around line 73
                In makeHTML function
                the default params are set by these lines

                this suggestion didn’t work correct for me (running 0.9.5. after login to the manager, i first had to reload to display the tree in default order)
                i’ve come across a better working solution:
                in manager/frames/tree.php line 268 change
                new Ajax('index.php?a=1&f=nodes&indent=1&parent=0&expandAll=2', {method: 'get',onComplete:rpcLoadData}).request();
                

                to
                new Ajax('index.php?a=1&f=nodes&indent=1&parent=0&expandAll=2&dt=&tree_sortby=menuindex&tree_sortdir=ASC', {method: 'get',onComplete:rpcLoadData}).request();
                


                this js function is executed by body onload and therefore you don’t have to reload the manager first.

                btw: there is a ticket(http://modxcms.com/bugs/task/14) for the "Default Tree Sort order"-issue, which is in state "implemented". but as much as i can see, in 0.9.5 and 0.9.6rc3 this behavior isn’t implemented yet. did something gone wrong here?

                greetz
                JayBee