Search box widget

You use the Search box widget to enable users to search for content on your website. Once you drop the widget on a page, a text box for entering search keywords is displayed.

PREREQUISITES: You created at least one search index. For more information, see Administration: Create search indexes.

You can use the predefined widget templates, or, optionally, customize the default widget template or create a new template for the Search box widget. For more information, see Overview: Widget templates.

Configure the Search box widget

  1. Drag and drop the Search box widget on a page.
  2. In the upper-right corner of the widget, click the Edit button to open the designer of the Search box widget.
  3. Expand the Where to search? dropdown menu and select the search index you want to use for this search box.
    The search index is a predefined set of search content. For example, you can create a search index that contains all news. When a user enters a search word, it is applied to all news items on your website.

    NOTE: You can manage search indexes in Administration » Search indexes.

  4. Under Where to display search results?, click the Select a page button.

  5. From the list of pages, select a page and click Done selecting.

    NOTE: You can select the page on which the search box is located, as well as any other page. You can also change the selected page later on.

    IMPORTANT: You must add the Search results widget to the page that will display the search results.

  6. Click Save.

  7. To apply styling to the Search box widget, expand More options and set Style and CSS classes. CSS classes are applied to the <div> element that contains the Search box widget.
    In case you created predefined styles, you can use the Style dropdown menu, which lists your predefined styles. For more information about predefined styles, see Add predefined styles.

Advanced options

You can specify additional properties of the Search box widget by clicking the Advanced button in the designer. You can configure the following:

  • DisableSuggestions
    Enter true, so that Sitefinity CMS disables listed suggestions while typing in the search box.
  • SuggestionFields
    Lists the fields to be used in the search suggestions. You must include these fields in the search index.

Tags

Was this article helpful?