Sort order possibility?

Permalink Browser Info Environment
Is there any possibility to add a sort order besides the drag and drop?

Type: Discussion
Status: New
jimmybj
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Can you please clarify what you mean? I'm not sure I understand.
jimmybj replied on at Permalink Reply
jimmybj
Like "Sort by latest on top" "sort by recent) (descending or ascending)
jordanlev replied on at Permalink Reply
jordanlev
Oh, I understand. No, sorry -- that functionality does not exist.
jimmybj replied on at Permalink Reply
jimmybj
Is there any possibility to create and use it in an update?
jordanlev replied on at Permalink Reply
jordanlev
Sorry, but it's very unlikely that I will add this functionality. You're the only person to ever ask for it, so I don't want to complicate the code and clutter the UI with something that most people won't be using.

If there's just one sort order that you know you'll always want, a solution could be to download my free "Simple Image Gallery" addon (http://concrete5.org/marketplace/addons/simple-image-gallery... ) and modify the code to sort them as needed. Let me know what sort order you would want it to use and I can tell you what code to swap out.

But if you need to be able to choose from various sort orders in the edit window, unfortunately I don't have a solution for you.
trompeten replied on at Permalink Reply
trompeten
count me as number two who would like that option.
graviton replied on at Permalink Reply
graviton
Hello,

I also purchased Deluxe image gallery.


I would also like to have gallery with automatically sorting "Sort by latest on top" when one upload latest picture in gallery.

Can you tell us for "Simple Image Gallery" what code to swap out and where? That would be mindblastish.

Thank you in advance.

M
jordanlev replied on at Permalink Reply
jordanlev
I looked at the core code, and actually I am not sure it's possible at all to sort files by date. I Think I see a way that you could sort by the timestamp, but this is only the last time any data changed for the image (which might be good enough for you in this case). To modify the Simple Image Gallery to sort on the timestamp, I think you could change line #15 in /packages/simple_image_gallery/models/simple_image_gallery.php from this:
$fl->sortByFileSetDisplayOrder();

...to this:
$fl->sortBy('timestamp', 'DESC');


I'm not 100% sure about this, but it's worth a try.

-Jordan

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.