Custom Sort 1.6?

Is custom sort missing in 1.6? It is in the description but not in the dropdown. In 1.5x I used custom sort using the sub-location field, I have Lightroom writing a sequencing number to this field. Mine defaulted to manual after installing 1.6

Comments

  • acrylian Administrator, Developer
    edited December 2022

    From the backend the interface it has indeed been removed, please see the release post section "General changes and fixes", around the middle why we did that and what you can do instead. It however requires some coding.

  • tplowe56 Member
    edited December 2022

    Hmmmm... I have over 300 albums using "iptcsublocation" as a custom sort. They are fine now but I would like to fix this as it is part of my work flow. Can you give me some instructions on how to code this?

    A search of the forum for "admin_sortbyoptions" yields zero.

  • acrylian Administrator, Developer
    edited December 2022

    Actually it was meant that existing custom sort orders keep working, just no interface for setting new ones. At least that worked in our tests when we changed that… Ist that the case?

    You will have to create a - actually rather simple - plugin to extend the fields list to sort by (the filter is new in 1.6 so you cannot find anything for it, we also have still to update our filter documentation). I will try to create a demo plugin for this - it's actually rather simple - but that may take some time.

  • Yes you are correct, images are still sorting according to "iptcsublocation", apparently due to restoring the DB. The image sort after upgrading to 1.6 is "Custom (webp)". If I change that option to manual and apply, the custom option disappears, unless I restore the DB. So the sort method appears to be persistent in the DB. But once changed it will be lost.

  • acrylian Administrator, Developer

    Hm, actually we try to keep already existing sortorder for albums to be kept. "webp" is a weird order of course… I don't remember that we set any default…

    If I change that option to manual and apply, the custom option disappears, unless I restore the DB.

    Yes, it disappears as soon as you change to anything else. It is only meant as a fallback.

    "Manual" of course means ordering via drag&drop sorting and not by any specific db column. (Mention it just in case…)


    You basically need a simple admin type plugin that does this (I have not tested if this works via a functions.php of a theme):

      zp_register_filter('admin_sortbyoptions', 'yourcustomorder');
    
      function yourcustomorder($orders, $type) {
         // you want to sort the images within real albums
         if ($type == 'images') {
            $orders['Display name for selector'] = 'dbcolumn'; // technically here combinations that are valid sql are possible as before
         }
        return $orders;
       }
    
  • I've looked into writing the sort plugin but it appears to above my skill level. Is there anyone with some coding skills that would be willing to do this for a fee?

  • acrylian Administrator, Developer

    As mentioned above - I think - I can/will make a demo plugin, but may take some time. Holiday season "between they years" and such…

  • Thanks Acrylian, Happy Holidays! I will check back in 2023.

  • acrylian Administrator, Developer

    As promised you find here a simple plugin template for this: https://github.com/zenphoto/DevTools/blob/master/plugins/admin_custom_sortorder.php

    Please see the in-file comments how to modify.

  • tplowe56 Member
    edited January 2023

    Thanks so much Malte!! I missed seeing this till yesterday. I got it working fine. Just had to enter in my actual sort field.
    $orders['IPTCSubLocation'] = 'IPTCSubLocation';

    This works great for ZP users who use Lightroom, which can write a specific sequence to any EXIF or IPTC field using the LR/Transporter plugin from https://www.photographers-toolbox.com/. I chose IPTCSubLocation years ago bc it is a field that is rarely (if ever) written to by the camera.

    So this transfers my custom sort used in LR to my website very efficiently. Both local and live sites are sorted custom, & exactly the same automatically.

    Thanks for all your great work.

  • Will custom sort order be incorporated into 1.6xxx? Or will it be a plug-in? I am currently using this customized plug-in (below) from Malte on Github, but the latest development release does not contain the option in admin or as a plug-in.

    https://github.com/zenphoto/DevTools/blob/master/plugins/admin_custom_sortorder.php

  • acrylian Administrator, Developer

    There will be no option anymore for reasons discussed above and also no plugin. It must be set via code as with the helper plugin you referenced.

  • Ok thanks, that plug-in does the job.

Sign In or Register to comment.