Forums Forums Search & Filter Pro Sort by Category

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #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
    #243993

    So, 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
    #244010

    Thanks 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
    #244058

    The 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.

    Anonymous
    #244127

    Thanks so much, Trevor. This is really helpful.

    Trevor
    #244130

    Can I close this thread for now?

    Anonymous
    #244175

    Yes. Thanks!

Viewing 7 posts - 1 through 7 (of 7 total)