Image sorting order in image galleries
naquah - April 23, 2006 - 10:02
| Project: | Image |
| Version: | 5.x-1.x-dev |
| Component: | image_gallery |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
The attached patch:
- allows users to configure how they want to sort images: most to least recent (default) or vice versa (chronologically);
- also sorts by the node's
nid.
The latter 'feature' might need some explanation. I use a mass image submission module, and images are submitted so fast that timestamps are exactly the same. If timestamps are the same for many images they get sorted randomly, and I do not want life to be random. This patch sorts nodes by their nid (so in the order they were added) when the timestamp is the same.
| Attachment | Size |
|---|---|
| image-order.patch | 2.88 KB |

#1
This patch will fix http://drupal.org/node/21037.
#2
Appearantly this patch will not apply anymore with the (unannounced?) splitting of image and image_gallery.
#3
Here's a patch against current version 5.x-1.x-dev of the file image/contrib/image_gallery/image_gallery.module.
It should apply fine now :)
#4
I get this error, after applying the patch to image_gallery 5.x-2.x-dev:
user warning: Unknown column '$order' in 'order clause' query: SELECT DISTINCT(n.nid) FROM node n INNER JOIN term_node tn ON n.nid = tn.nid WHERE tn.tid IN (15669,15737,16198,15679,16213,16193,15692,16212,15735,16211,15678,15759,15680) AND n.status = 1 ORDER BY n.sticky DESC, $order LIMIT 0, 1 in /srv/www/htdocs/includes/database.mysql.inc on line 178.
#5
As I said, it's a patch against 5.x-1.x-dev, not 2.x...
The 2.x version should have changed too much for it to apply cleanly. I'm not using the 2.x version, but it can probably be manually applied.
#6
looks pretty good, the only thing i'd like to see changed is a comment explaining why you're sorting by nid.
#7
marked http://drupal.org/node/188114 as a duplicate.
#8
The latest 2.x-dev release will allow you to add node ID as a sort criterion to the View that the galleries are generated with.
#9
Views also lets you sort by, say, title, or author, or ...
#10
Automatically closed -- issue fixed for two weeks with no activity.
#11
I just don't see this. I can't sort a gallery on my installation. I have Image 5.x-1.7 and Views 5.x-1.6. I don't see Image Gallery under default views, but I created a view called image_gallery and gave it a sort by title, but my gallery is still not sorted. I realize that I don't know what I am doing, and I am missing something, but the way you all talk about it leaves novices out of the loop. I don't mean to complain, but I just read through the docs, and the support tickets, and all and none of you are speaking my language.
Like I said, I am sure it is me. All I want to do is sort the Image Gallery. I have been at this for hours.
#12
This helped:
http://drupalworx.com/node/80
#13
http://drupal.org/node/21037 has a very nice patch for 5.x-1.x (and 5.x-2.x-dev).
smileybri: Views isn't integrated with image 5.x-1.x - you need 5.x-2.x-dev for that.