Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am interested in the ability to change the order in which images are added to a gallery. I would like to see an option for reverse chronological ordering.
Comment | File | Size | Author |
---|---|---|---|
#4 | media_gallery-reverse-order-1986470-4.patch | 698 bytes | fengtan |
Comments
Comment #1
keha3912 CreditAttribution: keha3912 commentedchange ASC to DESC in the file media_gallery.module two strings:
$query->orderBy('t.nid', 'DESC');
$query->orderBy('mgw.weight', 'DESC');
http://drupal.org/node/1142366
Comment #2
kuuser CreditAttribution: kuuser commentedI think they are asking how to do this (as am I): http://drupal.org/node/1815676 and not change the gallery album sorting
Comment #3
kuuser CreditAttribution: kuuser commentedI was able to do this (haven't checked for bugs yet) by changing this line in media_gallery.pages.inc from this: $items[] = $file; to this: array_unshift($items, $file);
Comment #4
fengtan#3 works for me, but only for newly added images.
Attached is a patch that displays files in reverse order (most recent first) on the gallery node although this brings new problems:
A possible workaround is to create a block (edit the gallery and check 'Create a block of most recently added media') which will show the most recent files first.
Comment #5
ivnish CreditAttribution: ivnish commented