Forums / Setup & design / Sorting Search Results by Section
Alex Jones
Wednesday 25 February 2004 7:39:16 am
How can I set up the advanced search to sort the results by Section? I have tried adding <i>"sort_by", array("section", true())</i> to <i>{set search=fetch...</i> at the top of my advancedsearch.tpl template (which I know is overriding properly), but it continues to mix the results.
Alex
Alex [ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ] <i>When in doubt, clear the cache.</i>
James Packham
Thursday 26 February 2004 7:35:10 am
You could try fetching a list of sections, then looping through through your search results, but only showing results that have a matching section attribute. That also has the advantage of your being able to change the order of the sections appearing and excluding sections from searches.
Regards,
James
Thursday 26 February 2004 1:18:37 pm
Yeah, I had pondered that, but was hoping there was a method built into the standard/advanced search functionality. Ahh well. Thanks for the feedback James!