Contensio logo

Search

Built-in full-text search across posts and pages, available at /search.

Contensio ships with a public search page at /search. No plugins, no external services, no configuration needed.

How it works

Visitors reach the search form at /search. Submitting a query searches across all published posts and pages (and any custom content types that are included in future versions) by:

  • Title
  • Excerpt
  • Body content

Results are returned paginated (using the Posts per page reading setting), ordered by most recently created. Each result shows the content type badge, publication date, author, featured image (if any), title, and excerpt.

Minimum query length

Queries shorter than 2 characters return no results (no query is executed). This prevents trivial single-character searches from hammering the database.

Linking to search from your theme

Add a search form anywhere in your theme pointing to the contensio.search named route:

<form method="GET" action="{{ route('contensio.search') }}">
    <input type="search" name="q" placeholder="Search…">
    <button type="submit">Search</button>
</form>

The route name is contensio.search. The query parameter is q.

Admin global search

The admin panel has a search box built into the top navigation bar. Type at least 2 characters — results appear on a dedicated results page split into two sections:

  • Content — matches against title and excerpt across all content types (pages, posts, custom types). Shows the content type label, status badge, and links directly to the edit screen.
  • Media — matches against the original file name. Shows a thumbnail for images.

The admin search is available at GET /{admin-prefix}/search?q=. It is separate from the public frontend search and requires a logged-in admin session.

Search in custom themes

The search controller renders theme::search. Create search.blade.php in your theme's views/ folder. The view receives:

Variable Type Description
$query string The submitted search query.
$results LengthAwarePaginator Paginated ContentTranslation objects with content eager-loaded.
$searched bool true if a query was submitted (even with zero results).
$site array ['name' => ..., 'tagline' => ...]
$lang Language|null The active language.