Global setting for subalbum sorting?

New to ZP, killer app from what I can tell so far (just a few hours).

I can't seem to figure out subalbum sorting. I see in the global options that you can set the sorting for galleries/_images_ and I see that on a per album level you can set the _subalbum_ sorting, but I don't see where to globally set how to sort _subalbums_.

I've read the forums and gather that subalbums are a newer feature, but I also see the PHP code to do the sorting etc. Sorry if I've missed a post that answers this.

Questions:
1. Is there a way to globally set the sorting for Subalbums?
2. If not, can someone suggest a code hack to _always_ sort subalbums by folder name (for example)?

I have a few thousand images that I'm looking to put online so I'd like to be able to set up global defaults for sorting etc., then upload all the photos.

Comments

  • There are settings on the album edit page for each subalbum and on the options pages for the main gallery.
  • I feel like I'm missing something. When you say "options for the main gallery" I'm assuming you mean the "Options" tab in the admin panel. However when I look in there I only see sorting options for sorting the gallery, not subalbums. Does the "Sort Gallery By" apply to both images and subalbums?

    Please see this screenshot, am I looking in the right area?
    http://relativity.org/zenphoto/temp/options.GIF.php

    Then notice the ordering of this gallery, which I have set to order by Filename. An "05..." albums comes after an "07..." gallery (and there are other places as well)
    http://relativity.org/zenphoto/2006/

    Thanks!
    Rich
  • The options page has the sorting options for the main gallery. If you go to the edit tab you will have a list of your albums. Clicking on an album will take you to a page that lets you edit options, etc. for the album. There you will find the sorting option for the album. At present, the album sort option does not default to the gallery sort, but that is a good idea.
  • While it still isn't super clear to me, I was able to get the behavior I wanted by adding the following change to class-album.php:

    'function getSubalbumSortKey($sorttype=null) {
    if (is_null($sorttype)) { $sorttype = $this->getSubalbumSortType(); }
    if (is_null($sorttype)) { $sorttype = "Filename"; } // added this line
    switch ($sorttype) {
    case "Title":
    ...'

    This made it such that newly created albums that contain subalbums will sort the subalbums using the Filename by default. It seemed to default to the manual sorting order before this change, which is the setting that i was thinking I would have been able to set from the "General Gallery Configuration" section under the "Options" tab.

    I hope that makes sense. Basically I couldn't figure out how to set a default / global setting for how to sort subalbums (at all levels). It seems this might be nice to have in the admin section.

    I'm migrating from Gallery where you basically set your global preferences, then can override any setting on a per albums basis. It seems ZP is similar to that, but is a bit different at least when determining how to sort subalbums in new albums. BTW ZP is a breath of fresh air after maintaining a large Gallery site.

    Let me know if I'm off my rocker, and regardless, thanks for chiming in.

    Cheers, Rich
  • Glad it works for you. We will implement inheritance of these options shortly. In the mean time, glad you have what you are looking for.
  • The feature of inheriting sort options will be in tonights build.
Sign In or Register to comment.