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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

keha3912’s picture

Assigned: Unassigned » keha3912

change 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

kuuser’s picture

I think they are asking how to do this (as am I): http://drupal.org/node/1815676 and not change the gallery album sorting

kuuser’s picture

I 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);

fengtan’s picture

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

  1. If you display the files in a block (edit the gallery, check 'Create a block of most recently added media' and place the block somewhere) then that block shows the oldest files first whereas it is supposed to show the most recent ones first
  2. Reordering files using the drag-and-drop will not work, e.g. if you drag a file to the last column and then refresh the page, then it will show up in the first column

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.

ivnish’s picture

Status: Needs work » Closed (outdated)