-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorting options #34
Comments
I believe I found the answer in another post... "newest" Is this all of them? |
Yes, currently thats all. In v2 it will be dateASC, dateDESC, nameASC, nameDESC and random. v2 is in internal alpha testing and gets public in next few months including a better documentation. |
I was just looking for the sorting options, glad I found this. Thanks for the work, the gallery is great. |
Don't know if of interest, I added the "nameDESC" by adding in // Sort alphabetically descending
protected function orderByNameDsc($list)
{
$ascOrder = $this->orderByName($list);
$dscOrder = array();
foreach (array_reverse($ascOrder, true) as $key => $value) {
$dscOrder[$key] = ($ascOrder[$key] = $value);
}
return $dscOrder;
} and expanding the protected function order($list, $order)
{
switch ($order) {
case 'defaultDSC':
// order alphabetically descending
$list = $this->orderByNameDsc($list);
break;
}
return $list;
} After that, one can add "sortAlbums": "defaultDSC" in the I know, it is a little hacky, but I works. Looking forward to see v2 of the novaGallery 😄. |
I see in the description that galleries and images can be sorted by date or name, but what are the other options to put in the setup.php file to get the different sorts?
"sortAlbums": "newest",
"sortImages": "newest",
The text was updated successfully, but these errors were encountered: