Quote from: peteedley at Oct 12, 2009, 03:55 PMFYI, it doesn’t work because I’m a dumbass and used !empty() instead of isset() in all the default parameter tests. If you could pass &sortbyAlias=`` (and possibly &sortdir=``) it would work fine without any other changes:
Quote from: OpenGeek at Oct 12, 2009, 03:40 PM
&sortby=`RAND()` ?
Fantastic thanks that doesn’t works but it did make me think about changing this line $criteria->sortby($sortby, $sortdir); to $criteria->sortby(’RAND()’);
$sortby = !empty($sortby) ? $sortby : 'publishedon'; $sortbyAlias = isset($sortbyAlias) ? $sortbyAlias : 'modResource'; if (!empty($sortbyAlias) $sortby = "`{$sortbyAlias}`.`{$sortby}`"; $sortdir = isset($sortdir) ? $sortdir : 'DESC';
&sortby=`menuindex,publishedon`
I should have some time tonight or tomorrow to work on this. Will keep you posted.
is there anything on schedule regarding getResources (sorting by multiple fields)?
Just asking because I do not want to hack the snippet if you expect an update within the next days/week(s).
No, my apologies, have had a lot on my plate recently. Will look at it tonight for sure.
Have you already had the time to look at multiple sort? Sorry for being so pesky.
Yeah, it is not as easy as I thought to implement either of these types of things without completely destroying the performance of the existing features. I’ll work on it more as I have time, but a generic solution to this is not going to happen overnight. In the meantime, I suggest writing a simple Snippet that looks specifically at the data you want it to. This will be much more efficient anyway, and you can use getResources as the model; just modify the query and you can still use the getPage Snippet with it, etc.
Hm, still no multiple sort? And I just realized that one cannot sort by a TV either, is that correct?