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.

AttachmentSize
image-order.patch2.88 KB

#1

praseodym - April 23, 2006 - 21:40

This patch will fix http://drupal.org/node/21037.

#2

naquah - May 4, 2006 - 12:14
Assigned to:naquah» Anonymous
Status:needs review» needs work

Appearantly this patch will not apply anymore with the (unannounced?) splitting of image and image_gallery.

#3

seventhguardian - December 10, 2007 - 19:08
Status:needs work» needs review

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 :)

AttachmentSize
image_gallery_order.patch 2.74 KB

#4

Hetta - December 11, 2007 - 10:01
Component:image.module» image_gallery

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

seventhguardian - December 15, 2007 - 13:18

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

drewish - December 18, 2007 - 23:07
Version:6.x-1.x-dev» 5.x-1.x-dev
Status:needs review» needs work

looks pretty good, the only thing i'd like to see changed is a comment explaining why you're sorting by nid.

#7

drewish - December 19, 2007 - 20:39

marked http://drupal.org/node/188114 as a duplicate.

#8

joachim - January 7, 2008 - 09:20

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

Hetta - February 3, 2008 - 08:19
Status:needs work» fixed

Views also lets you sort by, say, title, or author, or ...

#10

Anonymous (not verified) - February 17, 2008 - 08:21
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#11

smileybri - March 8, 2008 - 05:28

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

smileybri - March 8, 2008 - 06:00

#13

Hetta - March 10, 2008 - 07:07

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.

 
 

Drupal is a registered trademark of Dries Buytaert.