Search
Add your own search engine
If you are not happy with our built-in search for collections, you can create your own.
Keep in mind that the search component will be used for all searches of collections (e.g. pages, users, fields) that use the ->search()
method.
To replace the search for just one specific type of collection (e.g. for pages only), fall back on Kirby's native component for the rest:
Parameters
Name | Type | Default | Description |
---|---|---|---|
$kirby * | Kirby\Cms\App |
– | |
$collection * | Kirby\Cms\Collection |
– | Collection of searchable models |
$query | string |null |
'' |
|
$params | array |string |
[ ] |
Return type
Kirby\Cms\Collection
|bool