Voltar ao Painel

Documentação

Aprenda a usar o Asyntai

AI Search for Grav

Install our Grav plugin to put the AI Search Bar on your site

Open AI Search Bar

Overview

Grav sites are built from pages, and pages pile up. Visitors know what they want but not what you called it, so they give up on the search box. The AI Search Bar answers what they mean: type "when are you open at the weekend" and it finds your Opening hours page, even though not one of those words is in its title.

The plugin puts the bar on your site without any code. We read your pages ourselves, so there is no API key to create and nothing to paste.

Installing the Plugin

  1. Install it with GPM: bin/gpm install asyntai-ai-search. Or open Plugins in your Grav admin, press Add, and pick Asyntai AI Search. A zip you downloaded can be dropped into user/plugins/ as well.
  2. Open Asyntai AI Search in the admin menu on the left.
  3. Press Connect Asyntai. A window opens where you sign in or create a free account.
  4. Wait a few minutes while we read your site. The page tells you when the bar is live.

Your server has to be able to make outgoing HTTPS requests, because the plugin talks to us directly. Most hosts allow this. The plugin needs Grav 1.7 or newer.

Choosing Where the Bar Appears

There is one setting, Where the bar goes, under Plugins, then Asyntai AI Search. It has two answers.

In place of my theme's search box

The bar finds the search box your theme already shows, hides it, and takes exactly the same place. Nothing in your theme has to be edited. If a visitor presses Enter without picking a result, your usual search page still opens, so nothing they already know stops working.

Quark, the theme a new Grav site starts on, shows no search box unless you have added one, for example with the SimpleSearch plugin. On a site like that this setting has nothing to replace, and the Asyntai AI Search page says so. Use the Twig call instead.

Only where my theme calls asyntai_search()

Put {{ asyntai_search() }} in your theme where the bar should appear. It renders the bar while the bar is live, and nothing at all otherwise, so you can leave it in place for good.

  1. Open the template that renders your header. In Quark that is templates/partials/base.html.twig, or a partial it includes.
  2. Add the call where you want the bar, for example next to your navigation or at the top of the page body.
  3. Set Where the bar goes to Only where my theme calls asyntai_search() and save.

If you use a child theme, put the call in the child theme's copy of the template, so a theme update does not remove it.

The Other Settings

  • Search box to replace. Leave it empty and we find the box ourselves. Fill in a CSS selector only if we pick the wrong one, for example .search-wrapper.
  • Placeholder text. Leave it empty and each visitor sees it in their own language.
  • Accent colour. Leave it empty to use the colour set in your Asyntai dashboard.

Trying It Before Your Visitors Do

The Asyntai AI Search page has a Try your search bar button. It opens your real search bar, on your real content, in a new tab. Searches you run there do not count against your monthly allowance.

Plans and Limits

A site connected through this plugin runs the bar on any plan, including the free one. Your monthly reply allowance still applies, and searches and chat replies share it. The Asyntai AI Search page shows how much of the month is left.

When the allowance runs out, the bar removes itself and your theme's own search box comes straight back. Your visitors keep being able to search. They are never left typing into a box that answers nothing.

The plugin checks this in the background, so the bar comes back by itself when your allowance resets. You do not have to update or reinstall anything.

What the Bar Searches

Your pages, as we read them from your site. Blog posts, documentation and shop pages are all pages in Grav, so the bar finds them the same way.

If Something Does Not Work

  • No bar appears. Open the Asyntai AI Search page and read the line under the coloured dot. It says exactly why the bar is off.
  • It says your theme has no search box. Add the Twig call to your theme and set Where the bar goes to Only where my theme calls asyntai_search().
  • Could not reach Asyntai. Your server cannot make outgoing HTTPS requests. Ask your host to allow them.
  • The bar replaced the wrong element. Fill in Search box to replace with a CSS selector for the right one.
  • Grav signed you out during the connect step. Log in again and press Connect once more.
  • A change does not show. Clear the Grav cache from the admin, or run bin/grav clearcache.

Disconnecting

Press Disconnect this site on the Asyntai AI Search page. The bar stops at once and your usual search takes over. The plugin keeps its connection in user/data/asyntai-ai-search/; delete that folder if you uninstall the plugin and want nothing left behind.

Using the Chatbot as Well

This plugin adds the search bar only. To add the chat assistant too, follow our Grav chatbot guide. The two work side by side on the same pages and share the same knowledge base.