Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting results by provider type #38

Closed
Floriskoch opened this issue May 19, 2017 · 1 comment
Closed

Sorting results by provider type #38

Floriskoch opened this issue May 19, 2017 · 1 comment

Comments

@Floriskoch
Copy link

I'm using your plugin to search through cms pages and various types of records of my own plugin. What would be a good way of displaying the search results based on the type of record instead of just having one big list of search results? Thanks in advance!

@tobias-kuendig
Copy link
Member

If you update to the latest version 1.2.30 you can do something like this on your page:

title = "Search"
url = "/search"

[searchResults]

==
function onEnd() {
    $this['grouped'] = $this->components['searchResults']->resultCollection->groupBy('provider');
}
==

{{ grouped }}

You can grab the resultCollection variable and use it like any other Laravel collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants