Sortable?

Permalink Browser Info Environment
Can I sort the order the of the images in this gallery? It's been a pain using the free gallery block because it doesn't seem possible in that add on...

Cheers

Type: Discussion
Status: New
View Replies:
jb1 replied on at Permalink Reply
jb1
Thanks for your question. A sorting option isn't currently built in for a file set, but can be done with some editing of the controller. If you're comfortable with doing that let me know and I'll give you some instructions.

JB
EIanetti replied on at Permalink Reply
I would be comfortable doing that for both this add on and JQ Zoom Image.

Would you provide the information to use the set sort for C5.5.

Thank you.
jb1 replied on at Permalink Reply
jb1
For the Gallerific add-on, find the controller.php file and look for line 121 (assuming you're adding images from a fileset). You'll find an SQL statement like this:

$sql = "SELECT fsf.fID FROM FileSetFiles fsf WHERE fsf.fsID = " . $this->fsID;


Just replace it with:

$sql = "SELECT fsf.fID FROM FileSetFiles fsf WHERE fsf.fsID = " . $this->fsID . " ORDER BY fsf.fID ASC";


You can replace the sorted field with any other available in the db. It requires some understanding of the C5 table structure or phpMyAdmin access (or something similar).

For the jqZoom block it's a similar deal, but look for line 94 in the controller.php file.

Hope this helps.

JB
kreative replied on at Permalink Reply
kreative
I created a new attribute called Ordering and I assigned a value to each image. Now I want to sort my gallery in either ASC or DESC order based on this attribute.

How do I update the line below to do this?

$sql = "SELECT fsf.fID FROM FileSetFiles fsf WHERE fsf.fsID = " . $this->fsID . " ORDER BY fsf.fID ASC";
kreative replied on at Permalink Reply
kreative
I was really trying to sort my images based on their display order in the C5 file set. I figured out how to sort using this method instead of the "Ordering" attribute.

$sql = "SELECT fsf.fID FROM FileSetFiles fsf WHERE fsf.fsID = " . $this->fsID . " ORDER BY fsf.fsDisplayOrder ASC";
jb1 replied on at Permalink Reply
jb1
Ok, cool. Glad to hear it's working for you.

JB
webporter replied on at Permalink Reply
webporter
Thank you! This was very helpful!

JB - might be good to add this to the core of add-on. It makes sense to use the FileSet's sort order when using a fileset with Gallerific.

Cheers!

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.