On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi opengeek,

    maybe I'm missing something, but in 2.1.2pl (traditional) in '/core/model/modx/processors/resource/getnodes.php' the code's like this:
    /* get default properties */
    $sortBy = $modx->getOption('sortBy',$scriptProperties,'menuindex');
    


    Shouldn't this be a reference to the system setting you mentioned instead of the value 'menuindex' or was this changed in 2.1.3?

    I'm a little bit confused about that.

    Thanks for any help.
    • Quote from: herooutoftime at Aug 29, 2011, 11:37 AM
      Hi opengeek,
      maybe I'm missing something, but in 2.1.2pl (traditional) in '/core/model/modx/processors/resource/getnodes.php' the code's like this:
      /* get default properties */
      $sortBy = $modx->getOption('sortBy',$scriptProperties,'menuindex');
      


      Shouldn't this be a reference to the system setting you mentioned instead of the value 'menuindex' or was this changed in 2.1.3?
      No. The tree_default_sort is applied from System Settings via the modExt widget at manager/assets/modext/widgets/resource/modx.tree.resource.js. This is passed to the getNodes processor.
      • Ah, I got it...my mistake. Shame on me!

        Once more I need to bother:

        I would like to custom sort some parts (containers) of the resource tree and leave some parts by default. The "System Events" documentation (http://svn.modxcms.com/svn/tattoo/tattoo/branches/2.0/_build/data/transport.core.events.php) got me thinking:

        OnResourceBeforeSort
        Could I hook into this one and custom sort the tree?


        Really appreciate it! Thanks
        • Quote from: opengeek at Aug 11, 2011, 12:44 PM
          The tree_default_sort System Setting (under the area called Back-End Manager) controls this in Revolution.

          But what do you change it too?

          I can't see any fields or options to change it to a date or an id.

          [ed. note: markg last edited this post 4 years, 3 months ago.]
            Content Creator and Copywriter
          • It will take the name of any of the Resource fields. id, createdon, publishedon, etc.

            There's a full list here: https://bobsguides.com/modx-object-quick-reference.html#modResource
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
            • Quote from: BobRay at Apr 14, 2017, 04:53 AM
              It will take the name of any of the Resource fields. id, createdon, publishedon, etc.

              There's a full list here: https://bobsguides.com/modx-object-quick-reference.html#modResource

              Tried a few, doesn't seem to work. Maybe I'm missing something or expecting it to do something it can't.

              Is there some other setting that needs changing?

              I'd prefer title or date as the default sort order so I tried changing the value to publishedon and then pagetitle - no difference.
                Content Creator and Copywriter
              • Setting it to pagetitle should get them sorted by title. You may have to manually delete all files in the core/cache directory before it takes effect.

                For dates, you'd need to set it to createdon, publishedon, or editedon.

                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                • Quote from: BobRay at Apr 19, 2017, 07:45 PM
                  Setting it to pagetitle should get them sorted by title. You may have to manually delete all files in the core/cache directory before it takes effect.

                  For dates, you'd need to set it to createdon, publishedon, or editedon.


                  Yeah, that's what I tried, just doesn't work. I've cleared the cache about two dozen times and no change.

                  Or did you mean actually access the directory via a panel or ftp and delete all the folders that way?

                  I looked in there and it's kinda scary, there are config files and alls sorts in the cache directory.



                    Content Creator and Copywriter
                  • As long as you make sure you're in the cache directory, you can delete everything there. I've done it several hundred times.

                    Log out of the Manager before doing it (no harm if you don't, but you'll need to log out for MODX to regenerate your settings).
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting