Search

You need to install the search preset and manually enable this feature.

Statamic comes with great search functionality out of the box. If you want to use this you have to do some configuration and templating work. Peak comes with basic search support you can easily customize to suit your needs. To enable default search do the following:

  • Add
{{ partial:components/search_form }}
1

as the last list item in the main ul in resources/views/navigation/_main.antlers.html.

  • Add the following route to routes/web.php: Route::statamic('/search', 'search');
  • Add fields you want indexed to the index in config/statamic/search.php. The page_builder field is added by default.
  • Update the search index by running php please search:update --all.
  • Make sure you add the update command to your deployment script.

Note: the strings used in search form and result templates are translatable and can be edited in resources/lang/en/site.php.

Note: alternatively you could use Live Searchopen in new window by Jonas Siewertsenopen in new window. It uses Laravel Livewire to get live search results as you type. It's very easy to implement.