ZenphotoCMS Forum
Sort order of images found by tag search - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Sort order of images found by tag search (/thread-9045.html)



Sort order of images found by tag search - NaturalEnquirer - 2011-09-05

How is the default sort order set for images found by a tag search? E.g. galleries/page/search/tags/searchitem . I'd like images to be sorted by title, e.g.




Sort order of images found by tag search - sbillard - 2011-09-05

The default for a search is the gallery sort order.




Sort order of images found by tag search - NaturalEnquirer - 2011-09-06

Thank you.




Sort order of images found by tag search - tplowe56 - 2013-02-25

Is the statement above documented as fact or is there a bug?

I asked the same question in a different post and was given a different answer than the poster above.

My testing of approved themes does not show that searches can be sorted by the gallery order. Or by the custom options offered in gallery sort order.

I tried "filename,date" or "date,filename" as parameters for gallery sort, but it seemed to have no effect at all on the the search returned.

Actually....when I use custom sort "date,filename" I get a MySQL error when I initiate a search.




Sort order of images found by tag search - acrylian - 2013-02-25

This topic is very old from a time the search engine was in its early state.

As noted on the other topic: Search order is by relevance (you don't expect another order for results, do you?). If you wish another you need to do that in the loops on your theme directly.

The only "search" results you can sort via the backend are dynamic albums (=saved searches).




Sort order of images found by tag search - zubizuri - 2013-03-25

Same Problem here,
i'm trying to sort my results in my search.php

$sorttype = 'title';
$sortdirection = "asc";
while (next_album(true, $sorttype, $sortdirection)):
...

But whatever value i use for $sorttype it does not change the order.
Same code is working flawless on my index/album.php.

Ideas? Is it a bug? There has to be a way to order the results. I'm using tags as a part of the navigation, so ordering by relevance does not make sense here.




Sort order of images found by tag search - sbillard - 2013-03-26

Yes, it is a bug.




Sort order of images found by tag search - zubizuri - 2013-03-26

Well okay.
finally i did a workaround by collecting and sorting the albums in an array.
So do i have to open a ticket or something for this bug??

Thanks for your reply!




Sort order of images found by tag search - sbillard - 2013-03-26

Ideally you would open a ticket so the fix could be tracked. But since the fix is now in the support build there is no need.