Grouping search results
Hey Low
I am searching one collection and need to split the results by category. So for example I need to have header 'Category One' with the relevant results beneath, then 'Category Two' with its results under it.
Do you have a suggested way of doing this with Low Search? Would I perhaps have to loop through the results twice in the results template?
Thanks again
Replies
Low 12 Aug 2013 20:32
Think of the search:results tag just like you would the channel:entries tag. You can get the output the same way the channel:entries tag would. So, grouping by category isn't necessarily obvious. Either use multiple Results tags and hard code the category, or use something like Stash or PHP on output to group results by category...
Russ Back 13 Aug 2013 09:03
Great, thanks Low.
Been a while since I picked up an EE site and forgot that the channel entries class is extended