Use Google Custom Search Engine in KnowledgeOwl

Why don't you Google that…

Google is synonymous with search nowadays—and for good reason! If basic keyword search does not consistently return the information your users are looking for, Google's Custom Search Engine may be the answer you need.

Implementing Google CSE in KnowledgeOwl

To integrate Google CSE in to your KnowledgeOwl knowledge base, you'll need two things:

  1. A page to hold your CSE code
  2. A search form to send your users to the search page

Creating a page to hold the search results

The first is best accomplished with a new FAQ Navigation Category. This will provide a nice blank canvas for the search input and results to be displayed.

Inserting the CSE JavaScript snippet

The category description field is a convenient place to place your CSE JavaScript snippet. Using the Standard element type is the easiest to implement, though you may have to do a bit more work to override Google's default styles if you'd like a branded search form. Be sure to exclude this "category" from the table of contents.

Now's a good time to pause (and save), and check out your new search page! Click the permalink at the top of the screen to see your custom search page in action.

Adding search forms to your Home page or Articles

Allowing your users easy access to this search page is the next important piece of the puzzle. At its simplest, this could be set up with an ordinary hyperlink to the category page ("Click here for our search page").

You can go a step further by using an HTML form instead of a hyperlink. This will allow you to add a textbox, and pass the user's search terms as a query string to your search page. Google CSE automatically picks up queries embedded in the URL, so seamlessly integrating this new search capability anywhere in your knowledge base becomes a snap!

Below is an example of how this search form might look.

<form action="/help/article/link/search/" method="get">
   <input name="q" type="text">
   <button type="submit">Search</button>

Three important things to note:

  1. The form action points to the URL of the search "category page".
  2. The form method is "get".
  3. The text input name is "q".

The text input name you can actually change to whatever you'd like, be sure to make the necessary adjustments to your Google CSE code, so it knows to look for the query string by that variable name.

By including a form like the one above in the HTML section your Home Page Styles or perhaps the Right Column of Article Styles, your users will now have easy access to your crazy powerful Custom Search Engine!

A highly stylized search form