Forums › Forums › Search & Filter Pro › Sort by Category
Tagged: results
- This topic has 6 replies, 2 voices, and was last updated 4 years, 6 months ago by Anonymous.
-
Anonymous(Private) May 14, 2020 at 4:55 pm #243986
Is there a way to sort results by category? We’ve put together a prototype to show what we are trying to do: http://ssri-prototype.flywheelsites.com/about/people/
So rather than having a continuous list of all results, each category’s posts will be grouped and labeled together.
Trevor(Private) May 14, 2020 at 5:14 pm #243993So, does each post have only one category (otherwise, sorting by category would be problematic, which of many tags on any post should the sort use)? This why it is not an option in our UI
You can add a custom orderby (sort) using this filter;
https://searchandfilter.com/documentation/action-filter-reference/#edit-query-arguments
If you had a single term value custom field, then it would be possible, yes.
Anonymous(Private) May 14, 2020 at 5:41 pm #244010Thanks for the quick response. I think the title of my original question may be a little inaccurate. It’s the grouping and labeling the results that we are really asking about, not just sorting.
And that’s a great question about number of categories because they actually do have two each, a parent and a child. Ideally, we hoped the choosing “All Faculty” would list out all posts with the child categories of the parent “All Faculty,” but grouped and labeled by child (primary) category.
Trevor(Private) May 15, 2020 at 8:33 am #244058The display of the results (and thus dividing them by group and labeling is down to the Display Results Method you use, which in turn will determine what page builder or template files are used. As long as they are sorted, and you are using a PHP template, then a 3rd party coder could output headers/footers for each grouping by testing for changes in the taxonomies, as the loop progresses. Not a simple task, but It can be done.
-
AuthorPosts