We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1932
    • 137 Posts
    Hey Mark, I was wondering if you had planned to implement a natural order sort. It would be super useful when dealing with page titles that are identical except for an incrementing number. I was thinking about creating a custom field using an extender, and then sorting by that - but it doesn’t look like that would work currently.

    What do you think about adding this type of functionality? I guess the options are to run PHP’s natsort() on the data set or using pure MySQL and a sort query similar to the following:

    CONCAT(IF(ASCII(LEFT(table.field,1))>57,LEFT(table.field,1),'0'),IF(ASCII(RIGHT(table.f ield,1))>57,LPAD(table.field,10,'0'),LPAD(CONCAT(table.field,'-'), 10,'0')))
    
      • 18397
      • 3,250 Posts
      Ditto 2.1b4 supports custom sorts using extenders so you could write an extender to sort the data the way you wish. There should be a post somewhere in this forum that has more information on that type of extender.