The Nodeorder module http://drupal.org/project/nodeorder adds the frequently-requested ability to explicitly order nodes by creating an extra field, weight_in_tid, in the term_node table. This is set to the same initial value as tid unless nodeorder is used to change the value. It works fine, elegantly even with S/p Ajax. It takes me only a few minutes to set an order for 75 image nodes.
However image_gallery does not support this method of ordering so there's no way to use it.
It would save me from insanity and divorce if image_gallery could order by weight_in_tid if nodeorder is installed. The ordering method will be able to be switched between the default 'order by upload date' and 'order by weiight_in_tid' via nodeorder's options (can be turned on or off for a given taxonomy term).
This would save all the faffing around with .tpl.php methods of trying to order by title (part of the discussion at http://drupal.org/node/45050) - which I have never been able to get working correctly for images that inhabit multiple taxonomy terms. This is a major problem for me, trying to present photo stories and portfolios. Even ordering by title is not ideal. Nodeorder is a much better solution.
I've spent many hours trying to get image_gallery working with nodeorder. It looked like it should be easy but I have got to the point where I have to admit it is all way over my head.
If it helps get it added quickly, I'll offer a part-sponsored basis. I can't afford much ($200-$300) but am now desperate here. If the image_gallery developers don't see any mileage in adopting this I'd like to hear from anyone competent to hack whatever is necessary. I hope I'm not breaking any protocol by offering this.
Comments
Comment #1
Offlein commentedNote: Most of this is crossposted from a Nodeorder issue: http://drupal.org/node/117587
I'm sorry, about a week and a half ago I delved a little deeper into this and sort of figured out what was going on. I made a little hack, actually, and now NodeOrder works with my Flash Galleries. It's amazing.
Of course, the reason is the Flash Gallery module is hard coded to order by n.sticky DESC and then n.created DESC... Meaning if the image is sticky it'll go to the top first, and then the rest of the list is ordered via creation time, descending.
I modified the line (line 131 in mine) from..
"ORDER BY n.sticky DESC, n.created DESC"
into this, which is sorted Ascending, just cause it was easier for me to have the images I uploaded last appear at the end of the gallery by default..
"ORDER BY t.weight_in_tid ASC"
And it worked, as long as the images had been uploaded while NodeOrder was installed and active (hence, if there is a value in nodeorder's Weight column).
I assume there is something very similar going on with the imagegallery module. Search it for "ORDER BY" and see if you can replace it with t.weight_in_tid.
Comment #2
halftone commentedThanks, similar SQL iin image gallery is what I was fiddlling with and got lost with, probably because what I know about SQL can be written on a postage stamp in crayon. I'll have another go.
Comment #3
halftone commentedThere is now a solution at http://drupal.org/node/117587#comment-216897 :-)
It'd perhaps be nice if it made it into image_gallery as it simply reverts to normal sticky+desc.upload date if Nodeorder is absent.
Comment #4
halftone commentedI posted broken code. Corrected version at http://drupal.org/node/117587#comment-216930
Comment #5
halftone commentedAnd then I sabotaged the title of the issue by editing it. Doh.
Comment #6
sunComment #7
sunThe latest development snapshot contains support for Views. That should be sufficient to support nodeorder.