Adding a site search box to your website

Updated on 20-October-2016 at 10:16 AM

Business Catalyst End of life announcement - find out more details.

You can add a search box to the site template or any specific page so that visitors can search the site. To add a site search feature you need to:

  1. Create a page to display the search results.
  2. Add a search box to a template or page.
  3. Have the search box display the search results on the results page.

Create a page to display the search results

  1. Select Site Manager > Pages and click Add Page.
  2. Enter a page name like Search Results. The filename defaults to "search-results.html". Make a note of the filename.
  3. Make any other changes to the page.
  4. In the editor, enter {module_searchresults } where you want the results to appear on the page.
  5. Click Publish.

Add a search box to a template or page

  1. Open the template in editing mode by selecting Site Manager > Page Templates, and then choose the template you want to add the search box to from the list of templates.
  2. Place the cursor in the content editor where you want to insert the search box.
  3. In the Modules tab of the Toolbox found on the right of the editor, select Site Modules > Search, and then click Site Search Form.

    The default search module is configured to search the entire website except for secure zones. You can define search modules with different settings. See Define different searches .

  4. Click Insert.

    Business Catalyst inserts both the search box and the results module in the template.

  5. Delete the results module tag, {module_searchresults }.

    The results module is not used in the template. This is added to the results page.

  6. Click Save Draft.

Point to the results page

The next step is to ensure the search form in the template points to the results page you created.

  1. In the template editor, switch to code view by clicking the HTML tab on the lower part of the editor.
  2. Locate the form code.

    The form has an opening form tag and an action attribute. The action attribute looks as follows:

  3. Replace the PageID={module_oid} parameter with the path and filename of your results page. Example: ID=/search-results.html like so:
  4. Click Publish or Save Draft.

Define different searches

The default search module is configured to search the entire website except for secure zones. You can define different search "instances" with different settings that index different modules. For example. you can configure a site search module that only searches products or one that only indexes the webapps on your site.

  1. Go to Site Manager > Site Search > Add Search.
  2. Enter a name for the module.
  3. Specify the content to search.
  4. Click Save.

Excluding specific products from the site search

Specific products can be excluded from the site search - if you create a product and you do not want to have it included in the search index, you can manually exclude it from the product details panel by ticking this checkbox: