2015-08-08, 05:43:55
(This post was last modified: 2015-08-08, 06:07:31 by moonspider.)
I have a simple question, pretty sure there's got to be an answer for that.
I use return_i18n_search_results in my template for various lists. My pages also have numeric slugs, e.g. 01,02,03, etc.
Being a PHP noob that I am, at first I named everything straightforward with 1,2,3. But then came page 10 and all my search lists reavealed that 10 comes after 1 and not 9. I fixed the problem temporarily by adding a zero to the first 9 pages, but that's only until I get to page 100
In short, if I use 'reverseurl' and 'url' as $order, is there a way to sort the results in natural order so that 10 comes after 9 etc?
I tried sorting by creDate but that returns results in ascending order, and I sometimes need them descending. Btw, is there a way to do a reverse creDate?
I use return_i18n_search_results in my template for various lists. My pages also have numeric slugs, e.g. 01,02,03, etc.
Being a PHP noob that I am, at first I named everything straightforward with 1,2,3. But then came page 10 and all my search lists reavealed that 10 comes after 1 and not 9. I fixed the problem temporarily by adding a zero to the first 9 pages, but that's only until I get to page 100
In short, if I use 'reverseurl' and 'url' as $order, is there a way to sort the results in natural order so that 10 comes after 9 etc?
I tried sorting by creDate but that returns results in ascending order, and I sometimes need them descending. Btw, is there a way to do a reverse creDate?