We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23849
    • 223 Posts
    Hi All,

    I'm looking to use the GalleryAlbum "sort" parameter to sort my albums in the same order as they are sorted in the back-end, so user's can drag-and-drop albums into whatever order they would like, and then that order be reflected on the front-end.

    The default is "createdon", so I assumed this meant all of the normal fields were available to sort on. I tried "menuindex", thinking it would be the same as resources, but that causes all albums to disappear.

    Does anyone know how to get albums to display on the front-end the same as on the back-end?

    Let me know!
      Nick Hoag
      Creative Partner
      The FutureForward

      http://thefutureforward.com
      • 34030 ☆ A M B ☆
      • 23 Posts
      Hi,

      In Gallery–speak, this is actually called the ‘rank’ (from what I can determine) but I’ve been unable to sort it based on this.

      I created an issue on Github to this effect: https://github.com/splittingred/Gallery/issues/198

      You should add a +1 to the issue there smiley
        • 23849
        • 223 Posts
        oksushi,

        you are correct on the field being named 'rank' (rather than 'menuindex' for resources).

        and there is definitely a bug with drag/drop sorting, but this fixes it for the time being:

        Remove urldecode() on line 19 of core/components/gallery/processors/mgr/album/sort.class.php so it reads:

        $this->data = is_array($data) ? $data : $this->modx->fromJSON($data);
        [ed. note: presson83 last edited this post 14 years, 5 months ago.]
          Nick Hoag
          Creative Partner
          The FutureForward

          http://thefutureforward.com
          • 5357
          • 30 Posts
          No longer working for us under v1.5.2 and Revo 2.2.5-pl. Have updated the Github comments on that issue.
            • 5357
            • 30 Posts
            Anyone else still having image sort issues under 2.2.6 and Gallery 1.5.2?
              • 5357
              • 30 Posts
              In case anyone else is still having this issue, it seems that reinstalling getResources has fixed the issue for us.