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
Cheers
Type: | Discussion |
---|---|
Status: | New |
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.
Would you provide the information to use the set sort for C5.5.
Thank you.
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:
Just replace it with:
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
$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
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?
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";
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";
Ok, cool. Glad to hear it's working for you.
JB
JB
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!
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!
JB