icon Google Site Search
Created by Orckestra

Show technical information 

How to implement search results on a page

  1. Get the search engine unique ID .
  2. In the Content perspective, edit a page that will serve as the page for search results.
  3. Insert the Composite.Search.GoogleSiteSearch.SearchResult function or add the following code:
    Expand code
  4. Specify the required parameter:
    • SearchEngineId: The parameter specifies a unique code that identifies a custom search engine for your website
  5. Optionally, specify these parameters:
    • SearchTerm: The word or phrase to search for. By default the 'q' query string value will be used.
    • ResultsPerPage: The number of search results to display on the page ('10' by default)
  6. If necessary (e.g. for localization), change the texts displayed with the search results.

How to add the search box to multiple pages

To display the search box on multiple pages:

  1. In the Layout perspective, edit the template(s) these pages are based on.
  2. Insert the following HTML form markup where necessary:
    Expand code
  3. In the action attribute, specify the page with the Composite.Search.GoogleSiteSearch.SearchResult function (Insert | Page URL).
  4. Save the template(s).

How to localize the search results

As you provide new text strings, remember to use the system-defined parameters presented as {0}, {1} etc where appropriate within the strings.

  1. Edit the Composite.Search.GoogleSiteSearch.SearchResult function
  2. Select, and change the text in, the following parameters:
    • TextTitle: The text in the page title. By default '"{0}" - Search' where {0} stands for the search term specified.
    • TextResults: The heading for the search results. By default '{0} results for <em>"{1}"' where {0} stands for the number of results  and {1} - for the search term specified.
    • TextNoResults: The heading for no results.  By default 'No results for <em>"{0}"' where {0} stands for the search term specified.
    • TextSuggestion: The text used with the suggested search term. By default 'Did you mean  <em>"{0}"?' where {0} stands for the search term suggested.
    • TextButtonSearch: The text on the Search button ('Search' by default)

Important notes

  1. The free Google Custom Search Standard Edition does not work with the package.
  2. Your website should be registered with a paid Google Site Search edition.
  3. You should get the search engine unique ID (similar to '003098970302671473565:zufgbcyhdqs').
  4. You should keep the system-defined parameters presented as {0}, {1} when changing the text strings for the search results.

Customization

You can customize the layout of the search results by editing the style sheet:

~\Frontend\Composite\Search\GoogleSiteSearch\Styles.css