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 think this feature is one of the most useful and also one of the easiest to implement: sorting by date. In a gallery, it'd be much nicer to have recent pictures upto the top - especially you don't devide images in lots of images (no 'per event' galleries).
Comment | File | Size | Author |
---|---|---|---|
#43 | image_gallery_5--2_21037.patch | 4.36 KB | dman |
#37 | image_gallery_21037.patch | 4.36 KB | drewish |
#26 | image_gallery_sorting_6x.module.patch | 3.43 KB | andypost |
#24 | image_gallery_sorting_6x.module.patch | 3.4 KB | rwohleb |
#20 | image_gallery_sorting_6x_21037.patch | 3.13 KB | Hetta |
Comments
Comment #1
myadidas CreditAttribution: myadidas commentedI would think there should be some way to arrange the thumbnails after you've uploaded each picture. Something along the lines of the weight feature but for each gallery (although you would need to increase the bounded integer combo box for large galleries).
Comment #2
Bèr Kessels CreditAttribution: Bèr Kessels commentedHave a look at zhazamgallery [1] (beware: alpha), There is no weigting and ordering system yet, but that is in the pipeline. Probably in the next two weeks will I start with that. With some help, i want to get [2] an AJAX ordering system in.
What you request is indeed not possible. Nor is it, IMO agood feature
for this module. I,age module should be clean above everything else,
IMO.
[1]http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/ber/shazamgal...
[2]http://tool-man.org/examples/edit-in-place.html (Slideshow Sorter)
Comment #3
dmjossel CreditAttribution: dmjossel commentedHow can this not be a good feature for the module? I really cannot possibly understand this. My use of the 4.5 image module practically depended on being able to order thumbnails within a gallery, and to specify which image from a gallery was presented as the thumbnail representing that gallery.
The old module let you choose first, last, or random.
The new module chooses... well, something-- I've no idea how, and there's no way to change it, and no indication from the CHANGELOG about this feature being removed.
I can't even begin to list the number of times where a client has asked for images to be reordered in this way, and now there's simply no way to do it?
Comment #4
Bèr Kessels CreditAttribution: Bèr Kessels commentedYou did not understand my comment, I fear.
Things like ordering by Foo, by Bar, by user, date, size, popularity etcetc do NOT belong in the simple basic image handling, but in an advanced gallery.
where do we start? sort by date, where do we end? Sort by amount of red pixels? That is y point. You maywant to sort by foo, other by bar, yet others by fooBars etc. Again: this belongs in an advanced gallery module.
Comment #5
freyquency CreditAttribution: freyquency commentedI believe the gallery module should display one way: chronologically. When one clicks on the gallery of their choice it should show first->last. That would be the most logical way of displaying images that belong together.
Comment #6
underpressure CreditAttribution: underpressure commentedAny update?
I'm using 4.7 and would like uploaded pictures to be sorted by oldest first.
I recently took pictures of a funeral and I had to explain to many why pictures of the burial came before pictures of the church service.
Comment #7
drewish CreditAttribution: drewish commentedmarked http://drupal.org/node/107160 as a duplicate
Comment #8
drewish CreditAttribution: drewish commentedmarked http://drupal.org/node/147846 as a dulicate
Comment #9
drewish CreditAttribution: drewish commentedmarked http://drupal.org/node/179788 as a duplicate
Comment #10
underpressure CreditAttribution: underpressure commentedI take a lot of photos at Parties and concerts and have the same issue with sort order, You see photos of people going home at 3am before seeing photos of the party starting or the ending of a concert before the pre-show photos.
Beyond chronological order I think the other sort order should be in import.module since it is way for mass import with the image module. It will set the order in which images are imported/nodes created.
Anyone agree?
Comment #11
WeRockYourWeb.com CreditAttribution: WeRockYourWeb.com commentedI've been playing around trying to find the most practical, easy-for-clients-to-use image gallery in Drupal, and have played with acidfree; gallery2 embedded; flash gallery; cck image, views, thickbox combo; but finally settled on the standard image module + gallery + mass import. I would also love to see this feature. As soon as I find extra time I'll see how difficult it might be to implement this.
Comment #12
betonarbejder CreditAttribution: betonarbejder commentedI agree. Could really use some sorting feature. Just by date, filename or something of that kind
Comment #13
odysseus-1 CreditAttribution: odysseus-1 commentedSeeing as mine got marked duplicate I'll put my suggestion here. Currently the galleries defaults to ordered descending by nid, please give us a config option to choose ordered ascending by nid. It's not exactly hard, and doesn't fall into advanced functionality, it's about as basic as you can get. Options for ordered ascending/descending by title would be good too. Yes, this would only be at a global level, not at gallery level, but it's a start until someone comes up with a decent gallery module that includes weightings.
Comment #14
sander_123 CreditAttribution: sander_123 commentedinstalling weight.module, configuring only that it sets weight to image nodes is a solution!
(edit: it didn't actually.. i had to change the sort order in line 717 of image.module as well)
Comment #15
joachim CreditAttribution: joachim commentedI've made a patch that adds a Gallery view-type to the Views module, so you can create a gallery and sort it any way you like: http://drupal.org/node/134423
Comment #16
dman CreditAttribution: dman commentedSeeing as the duplicates are pointing here, I'll post my new patch (which I desired, needed, and came up with on my own) here as a possible solution.
I know that to go too much further into this sorta feature should be shifted into views or other 'advanced' configurations, but I like the simplicity of image_gallery and yes, this is a really really obvious request.
I was trying to demo to a client how easy it was to use image_import and just add a folder, and he just asked why they were all backwards! It was just so blindingly unintuative that I had to apologise to him, after convincing and lecturing to him on the importance of good file naming conventions...
The reverse chronological timestamp default makes sense in news sites, but sure doesn't with numbered or dated picture series.
SO anyway.
Here's the fix.
(Yes, I caught the typo after making the screenshot :)
Feel free to tell me that there's better ways of doing my SQL.
Comment #17
Hetta CreditAttribution: Hetta commentedI run 5.x-2.x-dev, so I added dman's patch (#16) to the image_gallery.module and ran it. Works a treat, but eh, doesn't sort by title, so I added that functionality. Please somebody give it a test run on their 5.x-2.x-dev install ...
Lovely patch, dman!
Comment #18
dman CreditAttribution: dman commentedYeah, I was thinking of doing titles as well, pretty easy, but, um, check the timestamp on that post. :-B
You don't need all that SQL of mine there if you just want title, it's already there in the normal lookup.
Just go
Comment #19
Hetta CreditAttribution: Hetta commentedOK, updated patch for 5.x-2.x-dev attached. It works a treat over here.
Thanks dman!
Comment #20
Hetta CreditAttribution: Hetta commentedOK, here's the dman's patch (plus sort by title) for 6.x, please test - it works a treat on my install.
(cos of this comment by drewish: http://drupal.org/node/232557#comment-764746 )
Comment #21
dman CreditAttribution: dman commentedAny objection to rolling this into production folks? Please?
It's wanted in 5, works, and looks good in 6.
As above, I know that the views hooks are the big, sexy way to do this, but image_gallery is deliberately lightweight and simple and this option is at the right level for many user who want to use it.
Comment #22
lindsayo CreditAttribution: lindsayo commentedThis broke my galleries.
What did I do wrong?
This line actually starts at 172.
I am running Drupal 6.1
Comment #23
dman CreditAttribution: dman commentedSorry, I haven't personally tried it with 6. Can only vouch for 5.
I'm thinking D6 went for file revisions, rather than just node ids. Anyone?
Comment #24
rwohlebHetta's patch is broken, at least on D6.1. It references files.nid, which doesn't exist. Here is a patch that seems to work.
Comment #25
dman CreditAttribution: dman commentedjust a note (I'm not on a dev site today)
Comment #26
andypost- Fixed {tables}
- Added translation t() to $options
Comment #27
jarintrn CreditAttribution: jarintrn commentedThank you very much, had the same problem.
Comment #28
trefor CreditAttribution: trefor commentedI have the dev snapshot of image and every time i want to upload and image i get the following errors
# warning: Division by zero in /home/sites/mysite.co.uk/public_html/includes/image.inc on line 160.
# Unable to create scaled Thumbnail image
# The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.
is this due to the module not being finished?
Thanks
Comment #29
Hetta CreditAttribution: Hetta commentedPlease don't hijack existing issues. Read the issue queue for various solutions to your problem, and if none of them work, create a new issue.
Thanks.
Comment #30
drewish CreditAttribution: drewish commentedi'm not sure about the queries that have order by fields that aren't in the select... i seem to remember pgsql not liking that...
Comment #31
Hetta CreditAttribution: Hetta commentedThe patch in #26 works on my D6 install without breaking things - and this time I tested all four sorting options.
Comment #32
trefor CreditAttribution: trefor commentedHetta.. apologies. new here.
Comment #33
Brian@brianpuccio.net CreditAttribution: Brian@brianpuccio.net commentedCouldn't this just be done with views?
Comment #34
dman CreditAttribution: dman commentedDisclaimer re views above, twice, in this thread.
5 lines of code vs 15000
A UI that just works rather than one that takes half a day to learn.
Simply, Views is cool, but a behemoth of a plugin to require when someone wants to add a list of images to their blog.
By the rationale of "Just use views", image_gallery.module itself would be totally redundant. I don't think it is, but a small improvement has been requested several times in history..
+1 Current patch #26 for me
Comment #35
dman CreditAttribution: dman commentedBump?
Ready to roll? Backport to 5? (It looks identical to me)
... although I can't see what the
INNER JOIN {image} i ON n.nid=i.nid
achieves?Comment #36
Hetta CreditAttribution: Hetta commentedAgreed with #34 - views is pretty, but on heavy duty sites it's too much. (I'm on a shared webhost, and my drupal install grabs 25+% (really) of the available CPU, with frequent core dumps).
So the fewer modules the better. Could we get this easy fix into image_gallery please?
Thanks!
Comment #37
drewish CreditAttribution: drewish commentedlooking pretty good. i made a few changes:
- cleaned up some coding standards issues.
- added a del_variable() to the hook_uninstall() implementation.
- reworked the way the query in image_gallery_page() is built so that we use the proper placeholders.
- renamed the constants to make them more consistent.
- i also found the sort setting names to be a bit confusing and renamed them.
if i can get a review to double check that i didn't break anything then i'll commit this and we can back port to 5.x-2.x. also, do the new sort settings names make sense?
Comment #38
dman CreditAttribution: dman commentedYipee!
Now that's a whole lotta love for this thing. Thanks for the professional once-over drewish!
Right. I tried it on a fresh D6. Goes exactly as planned.
Something needs to be changed for a D5 backport patch though. What's this 'image' table?
Some of us are still the D5 userbase at the moment :-)
Comment #39
Hetta CreditAttribution: Hetta commentedThe patch works a treat on D6, and I cycled through all 4 sorting options.
Eh, dman, "image" comes with 5.x-2.x-dev :-)
Comment #40
drewish CreditAttribution: drewish commentedThanks everyone, committed to HEAD (aka 6.x-1.x). Needs to be backported to 5.x-2.x now.
Comment #41
dman CreditAttribution: dman commentedUm yeah, I discovered image 5--2 today :-?
Comment #42
drewish CreditAttribution: drewish commentedComment #43
dman CreditAttribution: dman commentedLike this?
Seems OK to me on 5--2 now.
Comment #44
drewish CreditAttribution: drewish commentedlooks good to me, let the bug reports roll in ;)
thanks, committed to DRUPAL-5--2.
Comment #45
underpressure CreditAttribution: underpressure commentedWill 5.x-2.x be out of dev anytime soon? I really want to use thumbnail order.
Comment #46
drewish CreditAttribution: drewish commentedi guess i could post an -alpha1 release... to get some feedback
Comment #47
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.